changeset 10860:472c5531b695

Improved backwards seeking for small seek steps. Patch by matthieu <mat100@ifrance.com>.
author mosu
date Fri, 12 Sep 2003 21:47:28 +0000
parents 12e04913ba25
children 59e3d641c48c
files libmpdemux/demux_mkv.cpp
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.cpp	Fri Sep 12 19:14:56 2003 +0000
+++ b/libmpdemux/demux_mkv.cpp	Fri Sep 12 21:47:28 2003 +0000
@@ -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 @@
           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];
           }