Add reliable_sync_bit to FreeDV structure and handle audio passthrough in sched_waveform

This commit is contained in:
Ed Gonzalez 2015-01-30 10:13:46 -06:00
parent 1f92b51e61
commit c6a6c4fedd
3 changed files with 16 additions and 9 deletions

View file

@ -247,7 +247,7 @@ static void* _sched_waveform_thread(void* param)
int i; // for loop counter
float fsample; // a float sample
// float Sig2Noise; // Signal to noise ratio
float Sig2Noise; // Signal to noise ratio
// Flags ...
int initial_tx = 1; // Flags for TX circular buffer, clear if starting transmit
@ -437,13 +437,18 @@ static void* _sched_waveform_thread(void* param)
nout = freedv_rx(_freedvS, speech_out, demod_in);
// if(nout != 320 ) {
// output("NOUT not 320 it is %d\nNIN was %d\n", nout, nin);
// }
for( i=0 ; i < nout ; i++)
{
cbWriteShort(RX3_cb, speech_out[i]);
if ( nout == nin && _freedvS->reliable_sync_bit ){
for( i=0 ; i < nout ; i++)
{
cbWriteShort(RX3_cb, speech_out[i]);
}
} else {
for ( i = 0; i < nin ; i ++ ) {
cbWriteShort(RX3_cb, demod_in[i]);
}
}
}
// } else {
@ -467,7 +472,7 @@ static void* _sched_waveform_thread(void* param)
{
cbWriteFloat(RX4_cb, float_out_24k[i]);
}
//Sig2Noise = (_freedvS->fdmdv_stats.snr_est);
Sig2Noise = (_freedvS->fdmdv_stats.snr_est);
}
// Check for >= 128 samples in RX4_cb. Form packet and