radio: Fixed crash cause by not selecting any RX sink

pull/1/head
Andreas Eversberg 1 year ago
parent 86d4523cc7
commit d1f6a0f6ce
  1. 9
      src/radio/radio.c

@ -182,6 +182,11 @@ int radio_init(radio_t *radio, int buffer_size, int samplerate, double frequency
goto error;
#endif
}
/* if no sink was selected, we use dummy settings */
if (!rx_wave_file && !rx_audiodev) {
radio->rx_audio_samplerate = 48000;
radio->rx_audio_channels = (stereo) ? 2 : 1;
}
/* check if sample rate is too low */
if (radio->tx_audio_samplerate > radio->signal_samplerate) {
@ -739,10 +744,6 @@ int radio_rx(radio_t *radio, float *baseband, int signal_num)
}
}
#endif
if (!radio->rx_audio_mode) {
PDEBUG(DRADIO, DEBUG_ERROR, "Wrong audio mode, please fix!\n");
return -EINVAL;
}
return signal_num;
}

Loading…
Cancel
Save