From 63110cab94b56605e8df06b4295bf23544d5ed58 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Mon, 12 Dec 2011 13:59:33 +0000 Subject: [PATCH] liveadder: fix buffer leak --- gst/liveadder/liveadder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c index ada42a5477..205bd020dc 100644 --- a/gst/liveadder/liveadder.c +++ b/gst/liveadder/liveadder.c @@ -1091,10 +1091,11 @@ gst_live_live_adder_chain (GstPad * pad, GstBuffer * buffer) if (skip) { GstClockTime subbuffer_duration = GST_BUFFER_DURATION (buffer) - skip; GstClockTime subbuffer_ts = GST_BUFFER_TIMESTAMP (buffer) + skip; - - buffer = gst_buffer_create_sub (buffer, + GstBuffer *new_buffer = gst_buffer_create_sub (buffer, gst_live_adder_length_from_duration (adder, skip), gst_live_adder_length_from_duration (adder, subbuffer_duration)); + gst_buffer_unref (buffer); + buffer = new_buffer; GST_BUFFER_TIMESTAMP (buffer) = subbuffer_ts; GST_BUFFER_DURATION (buffer) = subbuffer_duration; }