mimdec: Don't overwrite valid timestamps
authorOlivier Crête <olivier.crete@collabora.co.uk>
Mon, 20 Jul 2009 18:00:17 +0000 (14:00 -0400)
committerOlivier Crête <olivier.crete@collabora.co.uk>
Wed, 22 Jul 2009 19:57:59 +0000 (15:57 -0400)
ext/mimic/gstmimdec.c

index 1323b15..5b28f45 100644 (file)
@@ -154,6 +154,7 @@ gst_mimdec_chain (GstPad * pad, GstBuffer * in)
   gint width, height;
   GstCaps *caps;
   GstFlowReturn res = GST_FLOW_OK;
+  GstClockTime in_time = GST_BUFFER_TIMESTAMP (in);
 
   GST_DEBUG ("in gst_mimdec_chain");
 
@@ -289,7 +290,10 @@ gst_mimdec_chain (GstPad * pad, GstBuffer * in)
       goto out;
     }
 
-    GST_BUFFER_TIMESTAMP (out_buf) = mimdec->current_ts * GST_MSECOND;
+    if (GST_CLOCK_TIME_IS_VALID (in_time))
+      GST_BUFFER_TIMESTAMP (out_buf) = in_time;
+    else
+      GST_BUFFER_TIMESTAMP (out_buf) = mimdec->current_ts * GST_MSECOND;
 
     mimic_get_property (mimdec->dec, "width", &width);
     mimic_get_property (mimdec->dec, "height", &height);