# HG changeset patch # User arpi # Date 1003688064 0 # Node ID 76778e307ddc257f9d57534295a08e89bdaa65a3 # Parent f6a10f4b61197f2c34ae259fd5cc919e3e6be9cf EOF bug fixed diff -r f6a10f4b6119 -r 76778e307ddc libmpdemux/cache2.c --- a/libmpdemux/cache2.c Sun Oct 21 18:13:48 2001 +0000 +++ b/libmpdemux/cache2.c Sun Oct 21 18:14:24 2001 +0000 @@ -37,6 +37,7 @@ int min_filepos; // buffer contain only a part of the file, from min-max pos int max_filepos; int offset; // filepos <-> bufferpos offset value (filepos of the buffer's first byte) + int eof; // commands/locking: int cmd_lock; // 1 if we will seek/reset buffer, 2 if we are ready for cmd int fifo_flag; // 1 if we should use FIFO to notice cache about buffer reads. @@ -67,6 +68,8 @@ if(newbeof) break; // waiting for buffer fill... usleep(10000); // 10ms continue; @@ -134,7 +137,8 @@ //len=stream_fill_buffer(s->stream); //memcpy(&s->buffer[pos],s->stream->buffer,len); // avoid this extra copy! // .... - stream_read(s->stream,&s->buffer[pos],space); len=space; + len=stream_read(s->stream,&s->buffer[pos],space); + if(!len) s->eof=1; s->max_filepos+=len; if(pos+len>=s->buffer_size){