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
This commit is contained in:
Wim Taymans 2012-08-13 10:57:57 +02:00
parent 85e45a09e2
commit a9f46ed059

View file

@ -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;
}