diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2021-11-20 10:05:32 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2021-11-20 10:05:32 +0100 |
commit | d1f6a0f6ce8002337f6bfec8b11ccaff2fe69c33 (patch) | |
tree | 0ef8f2c5c9e0b56e9f05d4b03cbcb7cf6e7938be /src/radio/radio.c | |
parent | 86d4523cc78e24e82c145aa79a125cc52b86cfcc (diff) |
radio: Fixed crash cause by not selecting any RX sink
Diffstat (limited to 'src/radio/radio.c')
-rw-r--r-- | src/radio/radio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/radio/radio.c b/src/radio/radio.c index d48e444..5354622 100644 --- a/src/radio/radio.c +++ b/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; } |