summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-12-16 10:55:20 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-12-16 10:58:33 +0100
commit0a74684b41831591e7a71187b59e59a78d0860b9 (patch)
tree777f441434f0d5908b6db40bb4e142775deb9968
parenteb56687a6dfd207507a4ca000eae53f93b5e33ea (diff)
basetransform: Handle downstream giving a buffer with new caps but invalid size
This can happen for example when downstream proposed new caps, later proposed the previous caps again which in turn enables passthrough mode in upstream elements and the wrong-sized buffer appears in an element where the caps change never happened. Simply allocate a new buffer in this case. See bug #635461.
-rw-r--r--libs/gst/base/gstbasetransform.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index 8bb7fb8f56..57192ab09f 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -1489,6 +1489,12 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans,
gst_buffer_unref (*out_buf);
*out_buf = NULL;
}
+ } else if (outsize != newsize) {
+ GST_WARNING_OBJECT (trans, "Caps did not change but allocated size does "
+ "not match expected size (%d != %d)", newsize, outsize);
+ if (in_buf != *out_buf)
+ gst_buffer_unref (*out_buf);
+ *out_buf = NULL;
}
/* these are the final output caps */