summaryrefslogtreecommitdiff
path: root/gst/videoparsers/gstmpegvideoparse.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-08-13 10:57:57 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2012-08-13 10:58:50 +0200
commita9f46ed05918bd134692026d10c4e6d976c13ca9 (patch)
tree40d3eae4e97b5629daafc9eab014aeb7a257920d /gst/videoparsers/gstmpegvideoparse.c
parent85e45a09e2410989d9be492a2d1710a8a3d97028 (diff)
downloadgstreamer-plugins-bad-a9f46ed05918bd134692026d10c4e6d976c13ca9.tar.gz
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
Diffstat (limited to 'gst/videoparsers/gstmpegvideoparse.c')
-rw-r--r--gst/videoparsers/gstmpegvideoparse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c
index 7892229bf..c8898af72 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;
}