Improved backwards seeking for small seek steps. Patch by matthieu <mat100@ifrance.com>.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10861 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
mosu 2003-09-12 21:47:28 +00:00
parent c61a9674f1
commit 45a22abd6c
1 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,9 @@
// Matroska demuxer
// written by Moritz Bunkus <moritz@bunkus.org>
// License: GPL of course ;)
// $Id$
extern "C" {
#include "config.h"
}
@ -2416,9 +2422,7 @@ extern "C" void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs,
if (!index->entries[k].is_key)
continue;
diff = target_timecode - (int64_t)index->entries[k].timecode;
if (diff < 0)
diff *= -1;
if (diff < min_diff) {
if ((diff > 0) && (diff < min_diff)) {
min_diff = diff;
entry = & index->entries[k];
}