[MPlayer-cvslog] r22458 - trunk/libmpdemux/demux_lavf.c

nicodvb subversion at mplayerhq.hu
Sun Mar 4 17:23:18 CET 2007


Author: nicodvb
Date: Sun Mar  4 17:23:18 2007
New Revision: 22458

Modified:
   trunk/libmpdemux/demux_lavf.c

Log:
when seeking consider stream->start_pos instead of 0 as initial position; patch by Zuxy Meng approved by Michael

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	(original)
+++ trunk/libmpdemux/demux_lavf.c	Sun Mar  4 17:23:18 2007
@@ -134,7 +134,9 @@ static offset_t mp_seek(URLContext *h, o
         pos +=stream_tell(stream);
     else if(whence == SEEK_END)
         pos += stream->end_pos;
-    else if(whence != SEEK_SET)
+    else if(whence == SEEK_SET)
+        pos += stream->start_pos;
+    else
         return -1;
 
     if(pos<stream->end_pos && stream->eof)
@@ -142,7 +144,7 @@ static offset_t mp_seek(URLContext *h, o
     if(stream_seek(stream, pos)==0)
         return -1;
 
-    return pos;
+    return pos - stream->start_pos;
 }
 
 static int mp_close(URLContext *h){



More information about the MPlayer-cvslog mailing list