diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2006-03-15 16:21:38 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2006-03-15 16:21:38 +0000 |
commit | 3a636c561fcb12bf51170c0a0ffeaddf5f4d157f (patch) | |
tree | 094c63d3d9cc768594168bf1f956f5fcddb5d3b1 /gst/id3demux/gstid3demux.c | |
parent | 50f4eb876a9d272847e22e3349309ce3f7ac42dc (diff) |
gst/apetag/gsttagdemux.c: Ensure that we set caps on the buffers we pass.
Original commit message from CVS:
* gst/apetag/gsttagdemux.c: (gst_tag_demux_chain):
Ensure that we set caps on the buffers we pass.
* gst/id3demux/gstid3demux.c: (gst_id3demux_chain),
(gst_id3demux_sink_activate):
Ensure that we set caps on the buffers we pass.
Use STREAM, TYPE_NOT_FOUND as the error class when
typefinding fails.
Diffstat (limited to 'gst/id3demux/gstid3demux.c')
-rw-r--r-- | gst/id3demux/gstid3demux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index a1ccfadd..6b7f073e 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -453,9 +453,9 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf) } /* We failed typefind */ - GST_ELEMENT_ERROR (id3demux, CORE, CAPS, + GST_ELEMENT_ERROR (id3demux, STREAM, TYPE_NOT_FOUND, ("Could not determine the mime type of the file"), - ("No caps found for contents within an ID3 tag")); + ("Could not detect type for contents within an ID3 tag")); gst_buffer_unref (typefind_buf); gst_buffer_unref (id3demux->collect); id3demux->collect = NULL; @@ -510,6 +510,11 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf) } GST_DEBUG_OBJECT (id3demux, "Pushing buffer %p", outbuf); + + /* Ensure the caps are set correctly */ + outbuf = gst_buffer_make_metadata_writable (outbuf); + gst_buffer_set_caps (outbuf, GST_PAD_CAPS (id3demux->srcpad)); + return gst_pad_push (id3demux->srcpad, outbuf); } } @@ -842,9 +847,9 @@ gst_id3demux_sink_activate (GstPad * sinkpad) /* 5 - If we didn't find the caps, fail */ if (caps == NULL) { - GST_ELEMENT_ERROR (id3demux, CORE, CAPS, + GST_ELEMENT_ERROR (id3demux, STREAM, TYPE_NOT_FOUND, ("Could not determine the mime type of the file"), - ("No caps found for contents within an ID3 tag")); + ("Could not detect type for contents within an ID3 tag")); goto done_activate; } |