Commit 50273537 authored by Robert Swain's avatar Robert Swain Committed by Tim-Philipp Müller

qtdemux: Round timestamp up when scaling to mov format

Fix timestamp rounding to allow the correct index to be located.

The issue was that scaling from GStreamer time format to mov time format was
rounding down causing the timestamp of the newsegment event received after a
flushing keyframe seek to find the sample index before the one it should
causing further backward seeking to the keyframe prior until no rounding error
occurred.

Rounding up when scaling to mov format has the desired effect, and it is
not clear whether just the _round () variant would be sufficient.

Fixes bug #619105
parent 6a9983cd
......@@ -817,7 +817,8 @@ gst_qtdemux_find_index_linear (GstQTDemux * qtdemux, QtDemuxStream * str,
guint32 index = 0;
/* convert media_time to mov format */
media_time = gst_util_uint64_scale (media_time, str->timescale, GST_SECOND);
media_time =
gst_util_uint64_scale_ceil (media_time, str->timescale, GST_SECOND);
if (media_time == result->timestamp)
return index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment