diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-01-14 20:19:05 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-01-14 20:19:05 +0100 |
commit | 0a0c32ef88883f9c45da5fc23c28dc5434a5251e (patch) | |
tree | 5a09a101e6c5094e66457841d9cd6111d8403a3b /libs | |
parent | b3d30dd459a125d5a2ede49eebc64b0ea47ef363 (diff) |
basetransform: Handle buffers with NULL caps correctly
This means that the caps didn't change so don't try to handle
the NULL caps as the new caps.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstbasetransform.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 95a610aa7..78ffc8d37 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1253,7 +1253,7 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans, /* check if we got different caps on this new output buffer */ newcaps = GST_BUFFER_CAPS (*out_buf); newsize = GST_BUFFER_SIZE (*out_buf); - if (!gst_caps_is_equal (newcaps, oldcaps)) { + if (newcaps && !gst_caps_is_equal (newcaps, oldcaps)) { GstCaps *othercaps; gboolean can_convert; @@ -1394,7 +1394,8 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans, * check. This is needed when we receive different pointers on the sinkpad * that mean the same caps. What we then want to do is prefer those caps over * the ones on the srcpad and set the srcpad caps to the buffer caps */ - setcaps = (newcaps != outcaps) && (!gst_caps_is_equal (newcaps, outcaps)); + setcaps = !newcaps || ((newcaps != outcaps) + && (!gst_caps_is_equal (newcaps, outcaps))); /* we need to modify the metadata when the element is not gap aware, * passthrough is not used and the gap flag is set */ copymeta |= !trans->priv->gap_aware && !trans->passthrough |