From 84eecaf722a41f75d8c2949551b9febfd92361e4 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 9 Apr 2019 22:26:26 +0100 Subject: [PATCH] use abort() to exit after a "die" call and fix the logic of opening the alsa device -- success was causing it to die, duh. --- audio_alsa.c | 5 +++-- common.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/audio_alsa.c b/audio_alsa.c index d3acf577..98cd6382 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -299,12 +299,13 @@ int actual_open_alsa_device(void) { // SND_PCM_NONBLOCK); ret = snd_pcm_open(&alsa_handle, alsa_out_dev, SND_PCM_STREAM_PLAYBACK, 0); if (ret < 0) { - if (ret == -ENOENT) - die("alsa: can't find output device \"%s\".", alsa_out_dev); + if (ret == -ENOENT) { + die("the alsa output_device \"%s\" can not be found.", alsa_out_dev); } else { char errorstring[1024]; strerror_r(-ret, (char *)errorstring, sizeof(errorstring)); die("alsa: error %d (\"%s\") opening alsa device \"%s\".", ret, (char *)errorstring, alsa_out_dev); + } } snd_pcm_hw_params_alloca(&alsa_params); diff --git a/common.c b/common.c index 2f52d69c..d1fb0b0f 100644 --- a/common.c +++ b/common.c @@ -176,7 +176,7 @@ void die(const char *format, ...) { else sps_log(LOG_ERR, "fatal error: %s", s); pthread_setcancelstate(oldState, NULL); - exit(1); + abort(); } void warn(const char *format, ...) {