From: Olivier CrĂȘte Date: Tue, 19 Aug 2008 22:49:51 +0000 (-0400) Subject: fsvalve: Revert "Fix refcounting issues in prepare_output_buffer" X-Git-Tag: RELEASE-0.10.32~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6119abb63cac4eaff205281f45b15044a971997f;p=platform%2Fupstream%2Fgstreamer.git fsvalve: Revert "Fix refcounting issues in prepare_output_buffer" This reverts commit 65dd460f0a3a9c4882e638c86208f74ef62c3460. --- diff --git a/plugins/elements/gstvalve.c b/plugins/elements/gstvalve.c index d70f8ba..c0f4163 100644 --- a/plugins/elements/gstvalve.c +++ b/plugins/elements/gstvalve.c @@ -212,25 +212,18 @@ gst_valve_prepare_output_buffer (GstBaseTransform *trans, GstBuffer * in_buf, } else { - /* Always return a reffed buffer, which in case of returning the input - * buffer means adding an extra ref to it */ if (valve->discont) { - if (gst_buffer_is_metadata_writable (in_buf)) - { - *out_buf = gst_buffer_ref (in_buf); - } - else - { - *out_buf = gst_buffer_create_sub (in_buf, 0, GST_BUFFER_SIZE (in_buf)); - } + *out_buf = gst_buffer_make_metadata_writable (in_buf); GST_BUFFER_FLAG_SET (*out_buf, GST_BUFFER_FLAG_DISCONT); valve->discont = FALSE; + } else { - *out_buf = gst_buffer_ref(in_buf); + *out_buf = in_buf; } + gst_buffer_ref (*out_buf); } GST_OBJECT_UNLOCK (GST_OBJECT (trans));