From 97ccdf9460549c04c2db5a6fae6633fa7d99c740 Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Mon, 4 May 2009 12:29:54 +0300 Subject: output-selector: unref latest buffer also when resending has been disabled --- gst/selector/gstoutputselector.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gst/selector') diff --git a/gst/selector/gstoutputselector.c b/gst/selector/gstoutputselector.c index 06443cfb..5635ab78 100644 --- a/gst/selector/gstoutputselector.c +++ b/gst/selector/gstoutputselector.c @@ -388,11 +388,14 @@ gst_output_selector_chain (GstPad * pad, GstBuffer * buf) /* Do the switch */ gst_output_selector_switch (osel); } + + if (osel->latest_buffer) { + gst_buffer_unref (osel->latest_buffer); + osel->latest_buffer = NULL; + } if (osel->resend_latest) { /* Keep reference to latest buffer to resend it after switch */ - if (osel->latest_buffer) - gst_buffer_unref (osel->latest_buffer); osel->latest_buffer = gst_buffer_ref (buf); } -- cgit v1.2.1