diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-01-29 23:20:45 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-01-29 23:20:45 +0000 |
commit | 51e5863a97bdfc80b5c2024236f990210f4541f8 (patch) | |
tree | a405601ca4a288858cdb43a438f31d5e5969674b /ext/esd | |
parent | 9925c8d04217e7e41993ee98fe77ddd02eb857a1 (diff) |
GST_ELEMENT_ERROR
Original commit message from CVS:
GST_ELEMENT_ERROR
Diffstat (limited to 'ext/esd')
-rw-r--r-- | ext/esd/esdmon.c | 2 | ||||
-rw-r--r-- | ext/esd/esdsink.c | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/ext/esd/esdmon.c b/ext/esd/esdmon.c index d728a885..6fd9c194 100644 --- a/ext/esd/esdmon.c +++ b/ext/esd/esdmon.c @@ -267,7 +267,7 @@ gst_esdmon_get (GstPad *pad) "channels", G_TYPE_INT, esdmon->channels )) <= 0) { - gst_element_error (esdmon, CORE, NEGOTIATION, NULL, NULL); + GST_ELEMENT_ERROR (esdmon, CORE, NEGOTIATION, NULL, NULL); return NULL; } } 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; } |