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.
This commit is contained in:
Sebastian Dröge 2010-12-16 10:55:20 +01:00
parent eb56687a6d
commit 0a74684b41

View file

@ -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 */