After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631633 - [oggdemux] fix seeking with negative rate with skeleton
[oggdemux] fix seeking with negative rate with skeleton
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-07 18:24 UTC by Guillaume Emont (guijemont)
Modified: 2010-10-10 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[oggdemux] fix seeking with negative rate with skeleton (2.45 KB, patch)
2010-10-07 18:27 UTC, Guillaume Emont (guijemont)
committed Details | Review

Description Guillaume Emont (guijemont) 2010-10-07 18:24:59 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
Comment 1 Guillaume Emont (guijemont) 2010-10-07 18:27:01 UTC
Created attachment 171914 [details] [review]
[oggdemux] fix seeking with negative rate with skeleton
Comment 2 Sebastian Dröge (slomo) 2010-10-10 16:26:40 UTC
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.