main demod processing loop runs without crashing
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 15 Oct 2012 21:19:49 +0000 (21:19 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 15 Oct 2012 21:19:49 +0000 (21:19 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@757 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/fdmdv2_main.cpp

index 88a31c60c278d685cc8b781273a97cb4b0b8b30c..0db8ab68169210766d202e739ee3c542c7639c3c 100644 (file)
@@ -1160,17 +1160,18 @@ int MainFrame::rxCallback(
        {
            in48k[i] = in48k[i + N48];
        }
-#ifdef RX_CB
+
+       assert((g_nInputBuf + N8) <= 2 * FDMDV_NOM_SAMPLES_PER_FRAME);
        // run demod, decoder and update GUI info
        for(i = 0; i < N8; i++)
        {
            g_RxInBuf[g_nInputBuf + i] = (short)out8k[i];
        }
        g_nInputBuf += FDMDV_NOM_SAMPLES_PER_FRAME;
-       per_frame_rx_processing(g_pRxOutBuf, &g_nInputBuf, g_CodecBits, g_RxInBuf, &g_nOutputBuf, &g_nRxIn, &g_State, g_pCodec2);
+       per_frame_rx_processing(g_pRxOutBuf, &g_nOutputBuf, g_CodecBits, g_RxInBuf, &g_nInputBuf, &g_nRxIn, &g_State, g_pCodec2);
     
-       cbData->pWFPanel->m_newdata = true;
-       cbData->pSPPanel->m_newdata = true;
+       //cbData->pWFPanel->m_newdata = true;
+       //cbData->pSPPanel->m_newdata = true;
     
        // if demod out of sync copy input audio from A/D to aid in tuning
        if (g_nOutputBuf >= N8)
@@ -1197,9 +1198,8 @@ int MainFrame::rxCallback(
         {
            g_pRxOutBuf[i] = g_pRxOutBuf[i + N8];
        }
- #endif
-       /* test: echo input to output */
+  
+       /* test: echo input to output, make this loopback option */
        for(i=0; i<N8; i++)
            in8k[MEM8+i] = out8k[i];
 
@@ -1221,7 +1221,7 @@ int MainFrame::rxCallback(
        fifo_write(cbData->outfifo, out48k_short, N48);
     }
 
-   /* OK now set up output samples */
+    /* OK now set up output samples */
 
     if (fifo_read(cbData->outfifo, outdata, framesPerBuffer) == 0) {