[Mplayer-cvslog] CVS: main/libmpdemux cache2.c,1.18,1.19
Arpi of Ize
arpi at mplayerhq.hu
Mon Jan 13 04:09:05 CET 2003
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv1034
Modified Files:
cache2.c
Log Message:
do not discard cache content at seeking type=STREAMTYPE_STREAM
(fixes quicktime streaming at low cache fill)
Index: cache2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cache2.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- cache2.c 23 Oct 2002 14:46:20 -0000 1.18
+++ cache2.c 13 Jan 2003 03:08:56 -0000 1.19
@@ -113,11 +113,16 @@
if(read<s->min_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 ||
+ read<s->min_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:
More information about the MPlayer-cvslog
mailing list