From: Keith Packard Date: Wed, 7 Oct 2009 03:06:00 +0000 (-0700) Subject: ao-view: fix snd_pcm_open return checking X-Git-Tag: debian/0.5+77+gc57bd7f~3^2~3 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=a3771bfc5ce740f9d89193e9f8b1d7987aa57264;p=fw%2Faltos 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 --- 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;