demux_mkv: Adjust seeks a bit to catch inexact keyframe matches
commit901ea8880ada6ba6d3468fc5a4d8b45d72872237
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Tue, 31 Mar 2009 16:30:14 +0000 (31 19:30 +0300)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Thu, 2 Apr 2009 03:51:26 +0000 (2 06:51 +0300)
treea66b77dd13fca0d93f004930e5d650cd5b7b3cf3
parent7db643095995ddf625af670f6e07a61bf25d3a94
demux_mkv: Adjust seeks a bit to catch inexact keyframe matches

Allow a seek to "time X or before" to match a keyframe at X plus 1 ms,
and correspondingly for seeks to "X or later". This allows seeks to a
known keyframe to succeed even if the time is not quite perfectly
exact.

The main motivation for this improvement was chapter seeking. Some
time ago things worked in practice because chapter times were slightly
below the exact target and demux_mkv seeked forward of the specified
position by default. Some commits ago demux_mkv started seeking
backward by default, which is generally a more desirable behavior, but
worked worse for the chapter times which happened to be slightly
behind a keyframe rather than ahead. After this commit chapter seeks
go to the desired keyframe again.
libmpdemux/demux_mkv.c