mpegvideoparse: set timestamp based on pic offset
authorDavid Schleef <ds@schleef.org>
Tue, 12 Feb 2013 00:35:48 +0000 (16:35 -0800)
committerDavid Schleef <ds@schleef.org>
Tue, 12 Feb 2013 01:41:17 +0000 (17:41 -0800)
Timestamps in MPEG-TS streams are based on the last timestamp
before the start code of the picture.  GstBaseParse sets the
timestamp based on the beginning of the sequence header, if
one exists before the picture.  This fixes the case where the
timestamp occurs in the MPEG-TS stream between the seq header
and picture start code.

configure.ac
gst/videoparsers/gstmpegvideoparse.c

index 1e8da9c..5b64eab 100644 (file)
@@ -51,7 +51,7 @@ dnl sets GST_LT_LDFLAGS
 AS_LIBTOOL(GST, 2, 0, 2)
 
 dnl *** required versions of GStreamer stuff ***
-GST_REQ=1.1.0
+GST_REQ=1.1.0.1
 GSTPB_REQ=1.1.0
 
 dnl *** autotools stuff ****
index a12e72d..2c2cfb2 100644 (file)
@@ -783,6 +783,10 @@ gst_mpegv_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
     GST_BUFFER_DURATION (buffer) = 0;
   }
 
+  if (mpvparse->pic_offset > 4) {
+    gst_base_parse_set_ts_at_offset (parse, mpvparse->pic_offset - 4);
+  }
+
   if (mpvparse->frame_repeat_count
       && GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer))) {
     GST_BUFFER_DURATION (buffer) =