changeset 12166:cceadb8af60b

nicer EOF solution, mpeg-ps works now too
author michael
date Sun, 11 Apr 2004 15:04:54 +0000
parents 6ae21c78ed8d
children 6421ebfc0018
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sun Apr 11 14:51:10 2004 +0000
+++ b/libmpdemux/demux_lavf.c	Sun Apr 11 15:04:54 2004 +0000
@@ -57,8 +57,7 @@
     if(stream_eof(stream)) //needed?
         return -1;
     ret=stream_read(stream, buf, size);
-    if(ret>0)
-        stream->eof=0;
+
     mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), eof:%d\n", ret, h, buf, size, stream->eof);
     return ret;
 }
@@ -78,10 +77,11 @@
     else if(whence != SEEK_SET)
         return -1;
 
+    if(pos<stream->end_pos)
+        stream_reset(stream);
     if(stream_seek(stream, pos)==0)
         return -1;
-    if(pos==stream->end_pos)
-        stream->eof=0;
+
     return pos;
 }