[MPlayer-cvslog] r31201 - trunk/stream/cache2.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon May 24 21:38:11 CEST 2010


On Mon, May 24, 2010 at 05:38:50PM +0300, Ivan Kalvachev wrote:
> Reimar, while you are working on cache2.c I'd like to make a feature request.
> 
> Could you try to find some workaround for the known problem with eof
> handling. For networks streams if playback is paused, server may
> disconnect the connection and cache would fail to resume, thinking it
> have reached the eof. Same thing happens with local files that are
> still growing.
> 
> The way I see it is by implementing EOF in 3 states.
> 0 - eof not reached
> 1 - eof reached, cache full.
> 2 - eof reached, cache empty, resume failed.

Do you have a nice test case?
I suspect you might be overcomplicating things, and something liek below
might work (I suspect it will not be enough, the eof handling is wildly
spread all over the place, probably left-overs from half-failed attempts
to fix various issues).
Index: stream/cache2.c
===================================================================
--- stream/cache2.c	(revision 31207)
+++ stream/cache2.c	(working copy)
@@ -225,7 +225,7 @@
   //memcpy(&s->buffer[pos],s->stream->buffer,len); // avoid this extra copy!
   // ....
   len=stream_read(s->stream,&s->buffer[pos],space);
-  if(!len) s->eof=1;
+  s->eof=!len;
 
   s->max_filepos+=len;
   if(pos+len>=s->buffer_size){


More information about the MPlayer-cvslog mailing list