From 168c8406b545037cc54c1c9346935e0057138a36 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 11 Feb 2013 16:35:48 -0800 Subject: [PATCH] Unrevert: mpegvideoparse: set timestamp based on pic offset API is now in baseparse in gstreamer. 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 | 2 +- gst/videoparsers/gstmpegvideoparse.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1e8da9cb3d..5b64eab70c 100644 --- a/configure.ac +++ b/configure.ac @@ -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 **** diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c index a12e72dd0b..2c2cfb29bf 100644 --- a/gst/videoparsers/gstmpegvideoparse.c +++ b/gst/videoparsers/gstmpegvideoparse.c @@ -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) =