output-selector: keep ref to buffer for resending only if explicitly requested
authorLasse Laukkanen <ext-lasse.2.laukkanen@nokia.com>
Thu, 16 Apr 2009 14:32:03 +0000 (17:32 +0300)
committerStefan Kost <ensonic@users.sf.net>
Fri, 5 Jun 2009 07:00:14 +0000 (10:00 +0300)
gst/selector/gstoutputselector.c

index bf354a740a2ccfda8a2f1b9f601ef35bdee0c29a..06443cfb6c16f723f6ad38b7518174874c718c1b 100644 (file)
@@ -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 */