[MPlayer-users] Re: matroska seeking problem

matthieu mat100 at ifrance.com
Fri Sep 12 22:52:13 CEST 2003


this should be better...

Index: libmpdemux/demux_mkv.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
retrieving revision 1.30
diff -u -r1.30 demux_mkv.cpp
--- libmpdemux/demux_mkv.cpp    10 Sep 2003 12:50:29 -0000      1.30
+++ libmpdemux/demux_mkv.cpp    12 Sep 2003 21:22:29 -0000
@@ -2416,9 +2416,9 @@
            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 *= -1;
+          if (diff > 0 && diff < min_diff) {
              min_diff = diff;
              entry = & index->entries[k];
            }

Mathhieu


matthieu wrote:
> Hi.
> 
> 
> 
>  >Maybe I'll find the time to implement that. But no promises.
> I have made a small patch that it seems to work...
> 
> matthieu
> 
> 
> Index: libmpdemux/demux_mkv.cpp
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
> retrieving revision 1.30
> diff -r1.30 demux_mkv.cpp
> 2419,2424c2419,2427
> <           if (diff < 0)
> <             diff *= -1;
> <           if (diff < min_diff) {
> <             min_diff = diff;
> <             entry = & index->entries[k];
> <           }
> ---
>  >           //if (diff < 0)
>  >             //diff *= -1;
>  >           if (diff < 0 && -diff < min_diff) {
>  >             min_diff = -diff;
>  >             entry = & index->entries[--k];
>  >           } else if (diff > 0 && diff < min_diff) {
>  >           min_diff = diff;
>  >           entry = & index->entries[k];
>  >         }
> 




More information about the MPlayer-users mailing list