use abort() to exit after a "die" call and fix the logic of opening the alsa device -- success was causing it to die, duh.

This commit is contained in:
Mike Brady
2019-04-09 22:26:26 +01:00
parent d3072ae827
commit 84eecaf722
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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);
+1 -1
View File
@@ -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, ...) {