summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2005-09-06 22:57:05 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2005-09-06 22:57:05 +0000
commit9f96921e901ad95a33cdbed8851a60e0c640f2d5 (patch)
treecf7a6f15e40c7f7ee934a1eb913b3ce324245eff
parent6f89a64207958e8c2f90dd0065f7e5655b5e59b8 (diff)
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.
-rw-r--r--ChangeLog6
-rw-r--r--gst/gstpad.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bbfc7206c..11164559b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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):
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 78e2c40ea..cc542cca4 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -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);