From 4abd3fb116979e75ca84492b1d4596f0d36cf736 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 21 Aug 2006 09:20:42 +0000 Subject: [PATCH] libs/gst/base/gstbasetransform.c: Only call downstream buffer_alloc if transform element is passthrough or always_in_... Original commit message from CVS: * libs/gst/base/gstbasetransform.c: (gst_base_transform_buffer_alloc): Only call downstream buffer_alloc if transform element is passthrough or always_in_place. Closes #350449. --- ChangeLog | 7 +++++++ libs/gst/base/gstbasetransform.c | 22 ++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1078ef887c..145d6bed4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-08-21 Edward Hervey + + * libs/gst/base/gstbasetransform.c: + (gst_base_transform_buffer_alloc): + Only call downstream buffer_alloc if transform element is passthrough + or always_in_place. Closes #350449. + 2006-08-20 Stefan Kost * ChangeLog: diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 6d501a966a..2d2b014e38 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1160,9 +1160,14 @@ not_configured: /* let the default allocator handle it... */ GST_DEBUG_OBJECT (trans, "not configured"); gst_buffer_replace (buf, NULL); - /* ...by calling alloc_buffer without setting caps on the src pad, which - * will force negotiation in the chain function. */ - res = gst_pad_alloc_buffer (trans->srcpad, offset, size, caps, buf); + if (trans->passthrough || trans->always_in_place) { + /* ...by calling alloc_buffer without setting caps on the src pad, which + * will force negotiation in the chain function. */ + res = gst_pad_alloc_buffer (trans->srcpad, offset, size, caps, buf); + } else { + /* ...by letting the default handler create a buffer */ + res = GST_FLOW_OK; + } goto done; } unknown_size: @@ -1170,9 +1175,14 @@ unknown_size: /* let the default allocator handle it... */ GST_DEBUG_OBJECT (trans, "unknown size"); gst_buffer_replace (buf, NULL); - /* ...by calling alloc_buffer without setting caps on the src pad, which - * will force negotiation in the chain function. */ - res = gst_pad_alloc_buffer (trans->srcpad, offset, size, caps, buf); + if (trans->passthrough || trans->always_in_place) { + /* ...by calling alloc_buffer without setting caps on the src pad, which + * will force negotiation in the chain function. */ + res = gst_pad_alloc_buffer (trans->srcpad, offset, size, caps, buf); + } else { + /* ...by letting the default handler create a buffer */ + res = GST_FLOW_OK; + } goto done; } }