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 | |
parent | 9925c8d04217e7e41993ee98fe77ddd02eb857a1 (diff) |
GST_ELEMENT_ERROR
Original commit message from CVS:
GST_ELEMENT_ERROR
Diffstat (limited to 'ext')
-rw-r--r-- | ext/aalib/gstaasink.c | 2 | ||||
-rw-r--r-- | ext/dv/gstdvdec.c | 2 | ||||
-rw-r--r-- | ext/esd/esdmon.c | 2 | ||||
-rw-r--r-- | ext/esd/esdsink.c | 12 | ||||
-rw-r--r-- | ext/flac/gstflacdec.c | 4 | ||||
-rw-r--r-- | ext/flac/gstflacenc.c | 6 | ||||
-rw-r--r-- | ext/flac/gstflactag.c | 8 | ||||
-rw-r--r-- | ext/gdk_pixbuf/gstgdkpixbuf.c | 2 | ||||
-rw-r--r-- | ext/mikmod/gstmikmod.c | 2 | ||||
-rw-r--r-- | ext/raw1394/gstdv1394src.c | 4 | ||||
-rw-r--r-- | ext/speex/gstspeexenc.c | 2 |
11 files changed, 26 insertions, 20 deletions
diff --git a/ext/aalib/gstaasink.c b/ext/aalib/gstaasink.c index fae02455..a7ae88e2 100644 --- a/ext/aalib/gstaasink.c +++ b/ext/aalib/gstaasink.c @@ -490,7 +490,7 @@ gst_aasink_open (GstAASink *aasink) aasink->context = aa_autoinit (&aasink->ascii_surf); if (aasink->context == NULL) { - gst_element_error (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, NULL, + GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, NULL, ("error opening aalib context")); return FALSE; } diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index e3e6cef6..3ed92241 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -783,7 +783,7 @@ gst_dvdec_loop (GstElement *element) dvdec->bpp = 2; } } else { - gst_element_error (element, CORE, NEGOTIATION, NULL, NULL); + GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, NULL, NULL); return; } } 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; } diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 17a4dda6..b4d857ba 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -305,7 +305,7 @@ gst_flacdec_error_callback (const FLAC__SeekableStreamDecoder *decoder, break; } - gst_element_error (flacdec, STREAM, DECODE, NULL, (error)); + GST_ELEMENT_ERROR (flacdec, STREAM, DECODE, NULL, (error)); } static FLAC__SeekableStreamDecoderSeekStatus @@ -535,7 +535,7 @@ gst_flacdec_loop (GstElement *element) GST_DEBUG ("flacdec: initializing decoder"); res = FLAC__seekable_stream_decoder_init (flacdec->decoder); if (res != FLAC__SEEKABLE_STREAM_DECODER_OK) { - gst_element_error (flacdec, LIBRARY, INIT, NULL, + GST_ELEMENT_ERROR (flacdec, LIBRARY, INIT, NULL, (FLAC__SeekableStreamDecoderStateString[res])); return; } diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index d8bfe509..df90c448 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -549,7 +549,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data) } if (!flacenc->negotiated) { - gst_element_error (flacenc, CORE, NEGOTIATION, NULL, + GST_ELEMENT_ERROR (flacenc, CORE, NEGOTIATION, NULL, ("format wasn't negotiated before chain function")); return; } @@ -575,7 +575,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data) gst_flacenc_set_metadata (flacenc); state = FLAC__seekable_stream_encoder_init (flacenc->encoder); if (state != FLAC__STREAM_ENCODER_OK) { - gst_element_error (flacenc, LIBRARY, INIT, NULL, + GST_ELEMENT_ERROR (flacenc, LIBRARY, INIT, NULL, ("could not initialize encoder (wrong parameters?)")); return; } @@ -610,7 +610,7 @@ gst_flacenc_chain (GstPad *pad, GstData *_data) flacenc->data = NULL; if (!res) { - gst_element_error (flacenc, STREAM, ENCODE, NULL, NULL); + GST_ELEMENT_ERROR (flacenc, STREAM, ENCODE, NULL, NULL); } } diff --git a/ext/flac/gstflactag.c b/ext/flac/gstflactag.c index ac0704b8..b5a780b7 100644 --- a/ext/flac/gstflactag.c +++ b/ext/flac/gstflactag.c @@ -295,7 +295,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data) gst_buffer_unref (sub); } else { /* FIXME: does that work well with FLAC files containing ID3v2 tags ? */ - gst_element_error (tag, STREAM, WRONG_TYPE, NULL, NULL); + GST_ELEMENT_ERROR (tag, STREAM, WRONG_TYPE, NULL, NULL); } } @@ -464,7 +464,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data) g_warning ("No tags found\n"); buffer = gst_buffer_new_and_alloc (12); if (buffer == NULL) { - gst_element_error (tag, CORE, TOO_LAZY, NULL, + GST_ELEMENT_ERROR (tag, CORE, TOO_LAZY, NULL, ("Error creating 12-byte buffer for padding block")); } bzero (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer)); @@ -481,7 +481,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data) sizeof (header), NULL); gst_tag_list_free (merged_tags); if (buffer == NULL) { - gst_element_error (tag, CORE, TAG, NULL, ("Error converting tag list to vorbiscomment buffer")); + GST_ELEMENT_ERROR (tag, CORE, TAG, NULL, ("Error converting tag list to vorbiscomment buffer")); return; } size = GST_BUFFER_SIZE (buffer) - 4; @@ -490,7 +490,7 @@ gst_flac_tag_chain (GstPad *pad, GstData *data) * while the vorbis specs allow more than that. Shouldn't * be a real world problem though */ - gst_element_error (tag, CORE, TAG, NULL, ("Vorbis comment of size %d too long", size)); + GST_ELEMENT_ERROR (tag, CORE, TAG, NULL, ("Vorbis comment of size %d too long", size)); return; } } diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 48ba463f..26d64b56 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -288,7 +288,7 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data) GError *error; if (gdk_pixbuf_loader_close (filter->pixbuf_loader, &error)) { - gst_element_error (filter, LIBRARY, SHUTDOWN, NULL, (error->message)); + GST_ELEMENT_ERROR (filter, LIBRARY, SHUTDOWN, NULL, (error->message)); g_error_free (error); return; } diff --git a/ext/mikmod/gstmikmod.c b/ext/mikmod/gstmikmod.c index 73eee2e4..5d6b0fc7 100644 --- a/ext/mikmod/gstmikmod.c +++ b/ext/mikmod/gstmikmod.c @@ -294,7 +294,7 @@ gst_mikmod_loop (GstElement *element) if (!GST_PAD_CAPS (mikmod->srcpad)) { if (gst_mikmod_negotiate (mikmod) <= 0) { - gst_element_error (mikmod, CORE, NEGOTIATION, NULL, NULL); + GST_ELEMENT_ERROR (mikmod, CORE, NEGOTIATION, NULL, NULL); return; } } diff --git a/ext/raw1394/gstdv1394src.c b/ext/raw1394/gstdv1394src.c index 1d8a58cb..432b7561 100644 --- a/ext/raw1394/gstdv1394src.c +++ b/ext/raw1394/gstdv1394src.c @@ -250,7 +250,7 @@ int gst_dv1394src_iso_receive(raw1394handle_t handle,int channel,size_t len,quad if (gst_pad_try_set_caps (dv1394src->srcpad, gst_caps_new_simple ("video/dv", "format", G_TYPE_STRING, "PAL", NULL)) <= 0) { - gst_element_error (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for PAL")); + GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for PAL")); return 0; } } else { @@ -260,7 +260,7 @@ int gst_dv1394src_iso_receive(raw1394handle_t handle,int channel,size_t len,quad if (gst_pad_try_set_caps (dv1394src->srcpad, gst_caps_new_simple ("video/dv", "format", G_TYPE_STRING, "NTSC", NULL)) <= 0) { - gst_element_error (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for NTSC")); + GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, NULL, ("Could not set source caps for NTSC")); return 0; } } diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index fac2fcc2..a4eb4532 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -210,7 +210,7 @@ gst_speexenc_chain (GstPad *pad, GstData *_data) "channels", G_TYPE_INT, 1, NULL))) { - gst_element_error (speexenc, CORE, NEGOTIATION, NULL, NULL); + GST_ELEMENT_ERROR (speexenc, CORE, NEGOTIATION, NULL, NULL); return; } } |