GNOME Bugzilla – Bug 619105
[qtdemux] misalignment between index and sample while looking for frame
Last modified: 2010-05-25 23:17:14 UTC
in gst_qtdemux_find_index_linear function of qtdemux.c index variable isn't align on the parsed sample, so the research of the correct sample don't give the correct result.
Created attachment 161469 [details] [review] patch for qtdemux
Review of attachment 161469 [details] [review]: Looks good to me. I would set accepted-commit_after_freeze but I'll leave that to someone with greater authority. :)
Are you sure this is correct? It seems to me that result is always one ahead of the index counter on purpose. The code inspects the next sample (result, samples[index + 1]) to see if the time is greater than the seektime and if so returns the index (which is one behind and hence refers to the sample before the one inspected). What does this fix for you exactly?
Created attachment 161972 [details] [review] 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 neither Wim nor I were certain whether just the _round () variant would be sufficient.
Pushed, thanks: commit 50273537dcc5a557fee3b24c9b0baf9abb4e5900 Author: Robert Swain <robert.swain@collabora.co.uk> Date: Tue May 25 21:14:05 2010 +0200 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