From a9f46ed05918bd134692026d10c4e6d976c13ca9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 13 Aug 2012 10:57:57 +0200 Subject: [PATCH] mpegvideoparse: only apply repeat count when set When there is no extension header, the repeat_count variable is left to 0 and then the duration on the output buffers is calculated wrongly. Because the duration is used to interpolate output timestamps, the output timestamps are also wrong, causing bad framerates. See https://bugzilla.gnome.org/show_bug.cgi?id=681535 --- gst/videoparsers/gstmpegvideoparse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c index 7892229bf6..c8898af72d 100644 --- a/gst/videoparsers/gstmpegvideoparse.c +++ b/gst/videoparsers/gstmpegvideoparse.c @@ -756,7 +756,8 @@ gst_mpegv_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame) GST_BUFFER_DURATION (buffer) = 0; } - if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer))) { + if (mpvparse->frame_repeat_count + && GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer))) { GST_BUFFER_DURATION (buffer) = (1 + mpvparse->frame_repeat_count) * GST_BUFFER_DURATION (buffer) / 2; }