diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2007-12-07 20:07:49 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2007-12-07 20:07:49 +0000 |
commit | 915732f5b5902ee6bc592c4b1e1cfd45baf79ca5 (patch) | |
tree | aa26e94d7cfaa92aa1c0fbee455e7482e53a69ec /sys/oss/gstosssink.c | |
parent | 0f1cc10947820ced5bb91b1957278722278bf9b3 (diff) |
sys/oss/: Post decent (and translated) error message when we can't open the audio device for some reason.
Original commit message from CVS:
* sys/oss/gstossaudio.c: (plugin_init):
* sys/oss/gstosssink.c: (gst_oss_sink_open):
* sys/oss/gstosssrc.c: (gst_oss_src_open):
Post decent (and translated) error message when we can't
open the audio device for some reason.
Diffstat (limited to 'sys/oss/gstosssink.c')
-rw-r--r-- | sys/oss/gstosssink.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c index 83c88476..17f3964a 100644 --- a/sys/oss/gstosssink.c +++ b/sys/oss/gstosssink.c @@ -77,6 +77,8 @@ #include "common.h" #include "gstosssink.h" +#include <gst/gst-i18n-plugin.h> + GST_DEBUG_CATEGORY_EXTERN (oss_debug); #define GST_CAT_DEFAULT oss_debug @@ -396,6 +398,8 @@ gst_oss_sink_open (GstAudioSink * asink) switch (errno) { case EBUSY: goto busy; + case EACCES: + goto no_permission; default: goto open_failed; } @@ -406,12 +410,23 @@ gst_oss_sink_open (GstAudioSink * asink) /* ERRORS */ busy: { - GST_ELEMENT_ERROR (oss, RESOURCE, BUSY, (NULL), (NULL)); + GST_ELEMENT_ERROR (oss, RESOURCE, BUSY, + (_("Could not open audio device for playback. " + "Device is being used by another application.")), (NULL)); + return FALSE; + } +no_permission: + { + GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE, + (_("Could not open audio device for playback." + "You don't have permission to open the device.")), + GST_ERROR_SYSTEM); return FALSE; } open_failed: { - GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE, (NULL), GST_ERROR_SYSTEM); + GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE, + (_("Could not open audio device for playback.")), GST_ERROR_SYSTEM); return FALSE; } } |