# HG changeset patch # User arpi # Date 1042427336 0 # Node ID fc21a94f98c68d573182e6235da17b2c53a932bb # Parent afca652cb0e5c6f847e7af3314301e08a95c0643 do not discard cache content at seeking type=STREAMTYPE_STREAM (fixes quicktime streaming at low cache fill) diff -r afca652cb0e5 -r fc21a94f98c6 libmpdemux/cache2.c --- a/libmpdemux/cache2.c Mon Jan 13 02:42:06 2003 +0000 +++ b/libmpdemux/cache2.c Mon Jan 13 03:08:56 2003 +0000 @@ -113,11 +113,16 @@ if(readmin_filepos || read>s->max_filepos){ // seek... mp_msg(MSGT_CACHE,MSGL_DBG2,"Out of boundaries... seeking to 0x%X \n",read); - s->offset= // FIXME!? - s->min_filepos=s->max_filepos=read; // drop cache content :( - if(s->stream->eof) stream_reset(s->stream); - stream_seek(s->stream,read); - mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%X \n",(int)stream_tell(s->stream)); + // streaming: drop cache contents only if seeking backward or too much fwd: + if(s->stream->type!=STREAMTYPE_STREAM || + readmin_filepos || read>=s->max_filepos+s->buffer_size) + { + s->offset= // FIXME!? + s->min_filepos=s->max_filepos=read; // drop cache content :( + if(s->stream->eof) stream_reset(s->stream); + stream_seek(s->stream,read); + mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%X \n",(int)stream_tell(s->stream)); + } } // calc number of back-bytes: