From: drowe67 Date: Fri, 4 May 2018 22:12:45 +0000 (+0000) Subject: fixed crash problem with squelch X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=831b6cf71f726503f1f8b71c60f52b8ae685143a;p=freetel-svn-tracking.git fixed crash problem with squelch git-svn-id: https://svn.code.sf.net/p/freetel/code@3578 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/freedv_api.c b/codec2-dev/src/freedv_api.c index d7d29283..74c8d7d3 100644 --- a/codec2-dev/src/freedv_api.c +++ b/codec2-dev/src/freedv_api.c @@ -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;