summaryrefslogtreecommitdiffstats
path: root/ext/esd/esdsink.c
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-01-29 23:20:45 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-01-29 23:20:45 +0000
commit51e5863a97bdfc80b5c2024236f990210f4541f8 (patch)
treea405601ca4a288858cdb43a438f31d5e5969674b /ext/esd/esdsink.c
parent9925c8d04217e7e41993ee98fe77ddd02eb857a1 (diff)
GST_ELEMENT_ERROR
Original commit message from CVS: GST_ELEMENT_ERROR
Diffstat (limited to 'ext/esd/esdsink.c')
-rw-r--r--ext/esd/esdsink.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c
index e61bed73..c0702140 100644
--- a/ext/esd/esdsink.c
+++ b/ext/esd/esdsink.c
@@ -252,6 +252,12 @@ gst_esdsink_chain (GstPad *pad, GstData *_data)
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
+ if (!esdsink->negotiated) {
+ GST_ELEMENT_ERROR (esdsink, CORE, NEGOTIATION, NULL,
+ ("element wasn't negotiated before chain function"));
+ goto done;
+ }
+
if (GST_IS_EVENT(buf)){
GstEvent *event = GST_EVENT(buf);
@@ -386,7 +392,7 @@ gst_esdsink_open_audio (GstEsdsink *sink)
if (sink->depth == 16) esdformat |= ESD_BITS16;
else if (sink->depth == 8) esdformat |= ESD_BITS8;
else {
- gst_element_error (sink, STREAM, FORMAT, NULL,
+ GST_ELEMENT_ERROR (sink, STREAM, FORMAT, NULL,
("invalid bit depth (%d)", sink->depth));
return FALSE;
}
@@ -394,7 +400,7 @@ gst_esdsink_open_audio (GstEsdsink *sink)
if (sink->channels == 2) esdformat |= ESD_STEREO;
else if (sink->channels == 1) esdformat |= ESD_MONO;
else {
- gst_element_error (sink, STREAM, FORMAT, NULL,
+ GST_ELEMENT_ERROR (sink, STREAM, FORMAT, NULL,
("invalid number of channels (%d)", sink->channels));
return FALSE;
}
@@ -406,7 +412,7 @@ gst_esdsink_open_audio (GstEsdsink *sink)
sink->fd = esd_play_stream(esdformat, sink->frequency, sink->host, connname);
}
if ( sink->fd < 0 ) {
- gst_element_error (sink, RESOURCE, OPEN_WRITE, NULL,
+ GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, NULL,
("can't open connection to esound server"));
return FALSE;
}