From 7b30d7b9a4ac01539fb410ae0aab5ec8a9880d53 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 26 Mar 2003 22:24:35 +0000 Subject: [PATCH] use err = snd_... instead of errno afterwards -- removed unnecessary include Original commit message from CVS: use err = snd_... instead of errno afterwards -- removed unnecessary include --- ext/alsa/gstalsa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index c2c77dc..9f31622 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -19,7 +19,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include "gstalsa.h" @@ -1085,9 +1084,11 @@ gst_alsa_update_avail (GstAlsa *this) inline static gboolean gst_alsa_pcm_wait (GstAlsa *this) { + int err; + if (snd_pcm_state (this->handle) == SND_PCM_STATE_RUNNING) { - if (snd_pcm_wait (this->handle, 1000) < 0) { - if (errno == EINTR) { + if ((err = snd_pcm_wait (this->handle, 1000)) < 0) { + if (err == EINTR) { /* happens mostly when run under gdb, or when exiting due to a signal */ GST_DEBUG (GST_CAT_PLUGIN_INFO, "got interrupted while waiting"); if (gst_element_interrupt (GST_ELEMENT (this))) { @@ -1096,7 +1097,7 @@ gst_alsa_pcm_wait (GstAlsa *this) return FALSE; } } - g_warning ("error waiting for alsa pcm: (%d: %s)", errno, strerror (errno)); + g_warning ("error waiting for alsa pcm: (%d: %s)", err, snd_strerror (err)); return FALSE; } } -- 2.7.4