liveadder: fix buffer leak

This commit is contained in:
Vincent Penquerc'h 2011-12-12 13:59:33 +00:00
parent 70d13bbb32
commit 63110cab94

View file

@ -1091,10 +1091,11 @@ gst_live_live_adder_chain (GstPad * pad, GstBuffer * buffer)
if (skip) { if (skip) {
GstClockTime subbuffer_duration = GST_BUFFER_DURATION (buffer) - skip; GstClockTime subbuffer_duration = GST_BUFFER_DURATION (buffer) - skip;
GstClockTime subbuffer_ts = GST_BUFFER_TIMESTAMP (buffer) + skip; GstClockTime subbuffer_ts = GST_BUFFER_TIMESTAMP (buffer) + skip;
GstBuffer *new_buffer = gst_buffer_create_sub (buffer,
buffer = gst_buffer_create_sub (buffer,
gst_live_adder_length_from_duration (adder, skip), gst_live_adder_length_from_duration (adder, skip),
gst_live_adder_length_from_duration (adder, subbuffer_duration)); gst_live_adder_length_from_duration (adder, subbuffer_duration));
gst_buffer_unref (buffer);
buffer = new_buffer;
GST_BUFFER_TIMESTAMP (buffer) = subbuffer_ts; GST_BUFFER_TIMESTAMP (buffer) = subbuffer_ts;
GST_BUFFER_DURATION (buffer) = subbuffer_duration; GST_BUFFER_DURATION (buffer) = subbuffer_duration;
} }