gst/gstpad.c: Catch misbehaving pad_alloc functions that don't set up caps and do it for them.

Original commit message from CVS:
* gst/gstpad.c: (gst_pad_alloc_buffer):
Catch misbehaving pad_alloc functions that don't
set up caps and do it for them.
This commit is contained in:
Jan Schmidt 2005-09-06 22:57:05 +00:00
parent 6f89a64207
commit 9f96921e90
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2005-09-07 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gstpad.c: (gst_pad_alloc_buffer):
Catch misbehaving pad_alloc functions that don't
set up caps and do it for them.
2005-09-07 Stefan Kost <ensonic@users.sf.net>
* check/pipelines/simple_launch_lines.c: (run_pipeline):

View file

@ -2379,6 +2379,15 @@ gst_pad_alloc_buffer (GstPad * pad, guint64 offset, gint size, GstCaps * caps,
if (G_UNLIKELY (*buf == NULL))
goto fallback;
/* If the buffer alloc function didn't set up the caps like it should,
* do it for it */
if (caps && (GST_BUFFER_CAPS (*buf) == NULL)) {
GST_WARNING ("Buffer allocation function for pad % " GST_PTR_FORMAT
" did not set up caps. Setting", peer);
gst_buffer_set_caps (*buf, caps);
}
do_caps:
gst_object_unref (peer);