From ba5e8e8382f22df26245d6702019f80fb63fcd18 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 19 Dec 2015 21:10:50 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/send.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/send.c') diff --git a/src/send.c b/src/send.c index 166a3b8..b841e1f 100644 --- a/src/send.c +++ b/src/send.c @@ -455,11 +455,13 @@ int main(int argc, char* argv[]) code = alloca(code_n * sizeof(*code)); /* Set up audio. */ - if (output_fd < 0) + if (output_fd >= 0) goto no_audio; r = snd_pcm_open(&sound_handle, "default", SND_PCM_STREAM_PLAYBACK, 0); if (r < 0) return fprintf(stderr, "%s: snd_pcm_open: %s\n", *argv, snd_strerror(r)), 1; + if (sound_handle == NULL) + perror("snd_pcm_open"); /* Configure audio. */ r = snd_pcm_set_params(sound_handle, FORMAT, SND_PCM_ACCESS_RW_INTERLEAVED, 1 /* channels */, SAMPLE_RATE, 1 /* allow resampling? */, LATENCY); -- cgit v1.2.3-70-g09d2