summaryrefslogtreecommitdiffstats
path: root/sys/dxr3/dxr3audiosink.c
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-01-18 21:46:58 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-01-18 21:46:58 +0000
commit07ed811a0983771c45faa2f6f76a9fff186db407 (patch)
tree1c0250da756e8b2dce0b660515d72ab1352a11d3 /sys/dxr3/dxr3audiosink.c
parentb1e81d454192223e58f3225aa44785e940a90fd7 (diff)
downloadgst-plugins-bad-07ed811a0983771c45faa2f6f76a9fff186db407.tar.gz
gst-plugins-bad-07ed811a0983771c45faa2f6f76a9fff186db407.tar.bz2
gst-plugins-bad-07ed811a0983771c45faa2f6f76a9fff186db407.zip
use new error signal and classification
Original commit message from CVS: use new error signal and classification
Diffstat (limited to 'sys/dxr3/dxr3audiosink.c')
-rw-r--r--sys/dxr3/dxr3audiosink.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/sys/dxr3/dxr3audiosink.c b/sys/dxr3/dxr3audiosink.c
index 58709e80..847c34b7 100644
--- a/sys/dxr3/dxr3audiosink.c
+++ b/sys/dxr3/dxr3audiosink.c
@@ -309,10 +309,9 @@ dxr3audiosink_open (Dxr3AudioSink *sink)
sink->audio_fd = open (sink->audio_filename, O_WRONLY);
if (sink->audio_fd < 0) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error opening device file \"",
- sink->audio_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, OPEN_WRITE,
+ (_("Could not open audio device \"%s\" for writing"), sink->audio_filename),
+ GST_ERROR_SYSTEM);
return FALSE;
}
@@ -322,10 +321,9 @@ dxr3audiosink_open (Dxr3AudioSink *sink)
sink->control_fd = open (sink->control_filename, O_WRONLY);
if (sink->control_fd < 0) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error opening device file \"",
- sink->control_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, OPEN_WRITE,
+ (_("Could not open control device \"%s\" for writing"), sink->control_filename),
+ GST_ERROR_SYSTEM);
return FALSE;
}
@@ -357,10 +355,9 @@ dxr3audiosink_set_mode_pcm (Dxr3AudioSink *sink)
tmp = oss_mode;
if (ioctl (sink->audio_fd, SNDCTL_DSP_SETFMT, &tmp) < 0 ||
tmp != oss_mode) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error configuring device mode for \"",
- sink->audio_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, SETTINGS,
+ (_("Could not configure audio device \"%s\""), sink->audio_filename),
+ GST_ERROR_SYSTEM);
return FALSE;
}
@@ -372,11 +369,9 @@ dxr3audiosink_set_mode_pcm (Dxr3AudioSink *sink)
/* Set the sampling rate. */
tmp = sink->rate;
if (ioctl (sink->audio_fd, SNDCTL_DSP_SPEED, &tmp) < 0) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error configuring device "
- "sampling rate for \"",
- sink->audio_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, SETTINGS,
+ (_("Could not set audio device \"%s\" to %d Hz"), sink->audio_filename, sink->rate),
+ GST_ERROR_SYSTEM);
return FALSE;
}
@@ -411,11 +406,9 @@ dxr3audiosink_set_mode_ac3 (Dxr3AudioSink *sink)
tmp = AC3_BYTE_RATE;
if (ioctl (sink->audio_fd, SNDCTL_DSP_SPEED, &tmp) < 0 ||
tmp != AC3_BYTE_RATE) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error configuring device "
- "sampling rate for \"",
- sink->audio_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, SETTINGS,
+ (_("Could not set audio device \"%s\" to %d Hz"), sink->audio_filename, AC3_BYTE_RATE),
+ GST_ERROR_SYSTEM);
return FALSE;
}
@@ -441,18 +434,16 @@ dxr3audiosink_close (Dxr3AudioSink *sink)
g_return_if_fail (GST_FLAG_IS_SET (sink, DXR3AUDIOSINK_OPEN));
if (close (sink->audio_fd) != 0) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error closing file \"",
- sink->audio_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, CLOSE,
+ (_("Could not close audio device \"%s\""), sink->audio_filename),
+ GST_ERROR_SYSTEM);
return;
}
if (close (sink->control_fd) != 0) {
- gst_element_error (GST_ELEMENT (sink),
- g_strconcat ("Error closing file \"",
- sink->control_filename, "\": ",
- g_strerror (errno), NULL));
+ gst_element_error (sink, RESOURCE, CLOSE,
+ (_("Could not close control device \"%s\""), sink->audio_filename),
+ GST_ERROR_SYSTEM);
return;
}