libs/gst/base/gstbasetransform.c: Don't passthrough buffer allocation too easily if the caps change.

Original commit message from CVS:
Based on a patch by: Sjoerd Simons <sjoerd at luon dot net>
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_buffer_alloc):
Don't passthrough buffer allocation too easily if the caps change.
This breaks when working in passthrough mode and upstream changes
it's caps. Fixes bug #526768.
This commit is contained in:
Sjoerd Simons 2008-05-08 05:55:34 +00:00 committed by Sebastian Dröge
parent f1bcc9c8a7
commit 849c17d326
2 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,13 @@
2008-05-08 Sebastian Dröge <slomo@circular-chaos.org>
Based on a patch by: Sjoerd Simons <sjoerd at luon dot net>
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_buffer_alloc):
Don't passthrough buffer allocation too easily if the caps change.
This breaks when working in passthrough mode and upstream changes
it's caps. Fixes bug #526768.
2008-05-07 Ole André Vadla Ravnås <ole.andre.ravnas at tandberg com>
* gst/gstinfo.c (gst_debug_log_valist):

View file

@ -1209,12 +1209,14 @@ not_configured:
/* let the default allocator handle it... */
GST_DEBUG_OBJECT (trans, "not configured");
gst_buffer_replace (buf, NULL);
if (trans->passthrough) {
/* ...by calling alloc_buffer without setting caps on the src pad, which
* will force negotiation in the chain function. */
if (gst_pad_accept_caps (trans->srcpad, caps)
&& gst_pad_peer_accept_caps (trans->srcpad, caps)) {
/* ...by seeing if the downstream elements can handle this */
res = gst_pad_alloc_buffer (trans->srcpad, offset, size, caps, buf);
} else {
/* ...by letting the default handler create a buffer */
/* If not fall back on the default handler and let things be
* renegotiated in the chain function */
res = GST_FLOW_OK;
}
goto done;