[MPlayer-cvslog] r23592 - trunk/libmpdemux/demux_mkv.c

uau subversion at mplayerhq.hu
Wed Jun 20 20:19:03 CEST 2007

Author: uau
Date: Wed Jun 20 20:19:03 2007
New Revision: 23592

demux_mkv very long seek fix

The seek code searching for the closest position in the index used
"int64_t min_diff=0xFFFFFFFL" as the initial "further from the goal
than any real alternative" value. The unit is milliseconds so seeks more
than about 75 hours past the end of the file would fail to recognize the
last index position as the best match. This was triggered in practice by
chapter seek code which apparently uses a seek of 1000000000 seconds
forward to mean "seek to the end". The practical effect was that trying
to seek to the next chapter in a file without chapters made MPlayer
block until it finished reading the file from the current position to
the end.

Fixed by increasing the initial value from FFFFFFF to FFFFFFFFFFFFFFF.


Modified: trunk/libmpdemux/demux_mkv.c
--- trunk/libmpdemux/demux_mkv.c	(original)
+++ trunk/libmpdemux/demux_mkv.c	Wed Jun 20 20:19:03 2007
@@ -3394,7 +3394,7 @@ demux_mkv_seek (demuxer_t *demuxer, floa
       mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv;
       stream_t *s = demuxer->stream;
-      int64_t target_timecode = 0, diff, min_diff=0xFFFFFFFL;
+      int64_t target_timecode = 0, diff, min_diff=0xFFFFFFFFFFFFFFFLL;
       int i;
       if (!(flags & 1))  /* relative seek */

More information about the MPlayer-cvslog mailing list