From a3771bfc5ce740f9d89193e9f8b1d7987aa57264 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 6 Oct 2009 20:06:00 -0700 Subject: [PATCH] ao-view: fix snd_pcm_open return checking I don't know how this code was supposed to work before... Signed-off-by: Keith Packard --- ao-tools/ao-view/aoview_flite.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ao-tools/ao-view/aoview_flite.c b/ao-tools/ao-view/aoview_flite.c index e1b75898..bc702b0f 100644 --- a/ao-tools/ao-view/aoview_flite.c +++ b/ao-tools/ao-view/aoview_flite.c @@ -42,12 +42,10 @@ aoview_flite_task(gpointer data) err = snd_pcm_open(&alsa_handle, "default", SND_PCM_STREAM_PLAYBACK, 0); - if (err >= 0) - { - if (err < 0) { - snd_pcm_close(alsa_handle); - alsa_handle = 0; - } + if (err < 0) { + fprintf(stderr, "alsa open failed %s\n", + strerror(-err)); + alsa_handle = NULL; } rate = 0; channels = 0; -- 2.30.2