diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2005-09-06 22:57:05 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2005-09-06 22:57:05 +0000 |
commit | 9f96921e901ad95a33cdbed8851a60e0c640f2d5 (patch) | |
tree | cf7a6f15e40c7f7ee934a1eb913b3ce324245eff /gst | |
parent | 6f89a64207958e8c2f90dd0065f7e5655b5e59b8 (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.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstpad.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); |