fixed crash problem with squelch
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 4 May 2018 22:12:45 +0000 (22:12 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 4 May 2018 22:12:45 +0000 (22:12 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3578 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/freedv_api.c

index d7d292831366aa3fd46c92c7bae815d33aecf0a4..74c8d7d381d9ca8ee76800100cde3a0d79fac505 100644 (file)
@@ -1773,7 +1773,7 @@ static int freedv_comprx_700d(struct freedv *f, COMP demod_in_8kHz[], int *valid
                 }
             } /* for interleave frames ... */
             
-            nout = f->n_speech_samples*interleave_frames;                  
+            nout = f->n_speech_samples;                  
 
             if (f->squelch_en && (f->stats.snr_est < f->snr_squelch_thresh)) {
                 *valid = 0;
@@ -1862,13 +1862,15 @@ int freedv_comprx(struct freedv *f, short speech_out[], COMP demod_in[]) {
 #endif
 
     if (valid == 0) {
+        //fprintf(stderr, "squelch nout: %d\n", nout);
+        
         /* squelch */
         
         for (i = 0; i < nout; i++)
             speech_out[i] = 0;
     }
     else if (valid < 0) {
-        /* we havent gor sync so play audio from radio.  This might
+        /* we havent got sync so play audio from radio.  This might
            not work for all modes due to nin bouncing about */
         for (i = 0; i < nout; i++)
             speech_out[i] = demod_in[i].real;