libs/gst/base/gstbasetransform.c: If the element is configured in passthrough mode but the prepare_output_buffer gave...

Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer):
If the element is configured in passthrough mode but the
prepare_output_buffer gave us a new output buffer, discard that buffer
and reuse the input buffer.
This commit is contained in:
Wim Taymans 2008-08-18 09:59:18 +00:00
parent fe969e6391
commit 077d96dec3
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2008-08-18 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer):
If the element is configured in passthrough mode but the
prepare_output_buffer gave us a new output buffer, discard that buffer
and reuse the input buffer.
2008-08-15 Wim Taymans <wim.taymans@collabora.co.uk> 2008-08-15 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Ole André Vadla Ravnås <ole.andre.ravnas at tandberg com> Patch by: Ole André Vadla Ravnås <ole.andre.ravnas at tandberg com>

View file

@ -1236,6 +1236,13 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans,
*out_buf = in_buf; *out_buf = in_buf;
} }
} else { } else {
if (trans->passthrough && in_buf != *out_buf) {
/* we are asked to perform a passthrough transform but the input and
* output buffers are different. We have to discard the output buffer and
* reuse the input buffer. */
GST_DEBUG_OBJECT (trans, "passthrough but different buffers");
discard = TRUE;
}
if (discard) { if (discard) {
GST_DEBUG_OBJECT (trans, "discard buffer, reuse input buffer"); GST_DEBUG_OBJECT (trans, "discard buffer, reuse input buffer");
gst_buffer_unref (*out_buf); gst_buffer_unref (*out_buf);