]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-good0-10.git/commitdiff
fixes to mux h264 stream utilizing ctts
authorRob Clark <rob@ti.com>
Tue, 28 Jun 2011 03:34:45 +0000 (00:34 -0300)
committerNikhil Devshatwar <a0132237@ti.com>
Wed, 15 May 2013 11:08:35 +0000 (16:38 +0530)
gst/isomp4/gstqtmux.c

index 5e9fcdd982d67ba405552bbd05e931a54503680b..83349e14b42eda9132dd6953250d9e1a4c6030ea 100644 (file)
@@ -2347,7 +2347,12 @@ again:
   } else {
     nsamples = 1;
     sample_size = GST_BUFFER_SIZE (last_buf);
-    if (pad->have_dts) {
+    /* note: by default offset_end will be 0, but qtdemux (and perhaps
+     * others) sets this to -1.  So treat either as invalid values.
+     */
+    if (pad->have_dts &&
+        (GST_BUFFER_OFFSET_END (last_buf) != -1) &&
+        (GST_BUFFER_OFFSET_END (last_buf) != 0)) {
       gint64 scaled_dts;
       pad->last_dts = GST_BUFFER_OFFSET_END (last_buf);
       if ((gint64) (pad->last_dts) < 0) {
@@ -3100,6 +3105,7 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
     }
 
     entry.fourcc = FOURCC_avc1;
+    qtpad->have_dts = TRUE;
     if (qtpad->avg_bitrate == 0) {
       gint avg_bitrate = 0;
       gst_structure_get_int (structure, "bitrate", &avg_bitrate);