From 1f1bfe8a09c38efb396327b1be59ef710e46ef4a Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 10 Nov 2005 18:47:20 +0000 Subject: [PATCH] ext/alsa/gstalsasink.c: check for ALSA errors properly, instead of relying on ALSA's error strings to serve to the user. Original commit message from CVS: * ext/alsa/gstalsasink.c: (gst_alsasink_open): check for ALSA errors properly, instead of relying on ALSA's error strings to serve to the user. --- ChangeLog | 6 ++++++ ext/alsa/gstalsasink.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b88c38690..5f47a14107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-10 Thomas Vander Stichele + + * ext/alsa/gstalsasink.c: (gst_alsasink_open): + check for ALSA errors properly, instead of relying on ALSA's + error strings to serve to the user. + 2005-11-10 Wim Taymans * ext/ogg/gstoggdemux.c: (gst_ogg_pad_event), (gst_ogg_demux_init), diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 961bee772c..c9b116052a 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -516,8 +516,12 @@ gst_alsasink_open (GstAudioSink * asink) /* ERRORS */ open_error: { - GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_READ, - ("Playback open error: %s", snd_strerror (err)), (NULL)); + if (err == -EBUSY) { + GST_ELEMENT_ERROR (alsa, RESOURCE, BUSY, (NULL), (NULL)); + } else { + GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_WRITE, + (NULL), ("Playback open error: %s", snd_strerror (err))); + } return FALSE; } }