output-selector: unref latest buffer also when resending has been disabled
authorLasse Laukkanen <ext-lasse.2.laukkanen@nokia.com>
Mon, 4 May 2009 09:29:54 +0000 (12:29 +0300)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 31 Dec 2010 00:53:49 +0000 (00:53 +0000)
plugins/elements/gstoutputselector.c

index 06443cf..5635ab7 100644 (file)
@@ -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);
   }