From 91b48c09de7461144ec7d7ec91cddcb3cc60e614 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 21 Oct 2017 05:57:51 +0200 Subject: [PATCH] TV: Fix case where no SDR nor wave file has been selected --- src/tv/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tv/main.c b/src/tv/main.c index 911d1e5..a107d53 100644 --- a/src/tv/main.c +++ b/src/tv/main.c @@ -288,7 +288,12 @@ static void tx_bas(sample_t *sample_bas, __attribute__((__unused__)) sample_t *s float *buff = NULL; void *sdr = NULL; int latspl = samplerate * latency / 1000; - float *sendbuff; + float *sendbuff = NULL; + + if ((sdr_config->uhd == 0 && sdr_config->soapy == 0)) { + fprintf(stderr, "You must choose SDR API you want: --sdr-uhd or --sdr-soapy or -w to generate wave file.\n"); + goto error; + } sendbuff = calloc(latspl * 2, sizeof(*sendbuff)); if (!sendbuff) {