From: Lasse Laukkanen Date: Thu, 16 Apr 2009 14:32:03 +0000 (+0300) Subject: output-selector: keep ref to buffer for resending only if explicitly requested X-Git-Tag: RELEASE-0.10.32~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c63ecb2b897439cb4e39ddf39e97d29cd45c8d97;p=platform%2Fupstream%2Fgstreamer.git output-selector: keep ref to buffer for resending only if explicitly requested --- diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c index bf354a7..06443cf 100644 --- a/plugins/elements/gstoutputselector.c +++ b/plugins/elements/gstoutputselector.c @@ -388,11 +388,13 @@ gst_output_selector_chain (GstPad * pad, GstBuffer * buf) /* Do the switch */ gst_output_selector_switch (osel); } - - /* 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); + + 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); + } /* Keep track of last stop and use it in NEWSEGMENT start after switching to a new src pad */