GNOME Bugzilla – Bug 631633
[oggdemux] fix seeking with negative rate with skeleton
Last modified: 2010-10-10 16:26:45 UTC
Files with a skeleton, or other files with a stream that ends before the end of the chain would start playing from the end of the chain when trying to seek with a negative rate at a position between the end of any stream and the end of the chain. Way to reproduce: 1. Load an ogg version of Monty's "A Digital Media Primer For Geeks" as distributed on xiph's site[1] with the seek example from tests/examples/seek. 2. Try seeking with a negative rate Expected result: Monty speaks backwards from the selected time in the video (by default, where the video was being played previously) What happens: playback starts from the end of the video. With the attached patch applied, we get the expected result. I didn't do measurement, but I believe this bug also slows down seeking, since the demuxer spends time looking for a keyframe that doesn't exist. Explanations on the code are in the commit message and in comments, in the attached patch. [1] http://downloads.xiph.org/video/A_Digital_Media_Primer_For_Geeks-360p.ogv
Created attachment 171914 [details] [review] [oggdemux] fix seeking with negative rate with skeleton
commit b41cd0428956f3ade9b428149e38be8e788556fe Author: Guillaume Emont <gemont@igalia.com> Date: Thu Oct 7 19:32:56 2010 +0200 oggdemux: fix seeking with negative rate with skeleton Files with a skeleton, or other files with a stream that ends before the end the chain would start playing from the end of the chain when trying to seek a negative rate at a position between the end of any stream and the end of t chain. This is due to the loop in _do_seek() assuming that pages will be encountere for all streams shortly after the place where we want to seek, as found by do_binary_search(). In the first iteration of the loop, stream ends are now checked against the time of the current page.