[Mplayer-cvslog] CVS: main/libmpdemux cache2.c,1.8,1.9 stream.h,1.17,1.18
Arpi of Ize
arpi at mplayer.dev.hu
Wed Dec 19 03:16:45 CET 2001
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv2984
Modified Files:
cache2.c stream.h
Log Message:
pre-cache fixed
Index: cache2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cache2.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cache2.c 17 Dec 2001 16:55:40 -0000 1.8
+++ cache2.c 19 Dec 2001 02:16:43 -0000 1.9
@@ -194,9 +194,8 @@
exit(0);
}
-void stream_enable_cache(stream_t *stream,int size,float prefill_init,float prefill){
+void stream_enable_cache(stream_t *stream,int size,int min,int prefill){
int ss=(stream->type==STREAMTYPE_VCD)?VCD_SECTOR_DATA:STREAM_BUFFER_SIZE;
- int min=prefill_init*size;
cache_vars_t* s=cache_init(size,ss);
stream->cache_data=s;
s->stream=stream; // callback
@@ -204,9 +203,11 @@
if((stream->cache_pid=fork())){
// wait until cache is filled at least prefill_init %
+ printf("CACHE_PRE_INIT: %d [%d] %d pre:%d eof:%d \n",
+ s->min_filepos,s->read_filepos,s->max_filepos,min,s->eof);
while(s->read_filepos<s->min_filepos || s->max_filepos-s->read_filepos<min){
mp_msg(MSGT_CACHE,MSGL_STATUS,"\rCache fill: %5.2f%% (%d bytes) ",
- (float)(s->max_filepos-s->read_filepos)/(float)(s->buffer_size),
+ 100.0*(float)(s->max_filepos-s->read_filepos)/(float)(s->buffer_size),
s->max_filepos-s->read_filepos
);
if(s->eof) break; // file is smaller than prefill size
Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- stream.h 17 Dec 2001 16:55:40 -0000 1.17
+++ stream.h 19 Dec 2001 02:16:43 -0000 1.18
@@ -42,7 +42,7 @@
} stream_t;
#ifdef USE_STREAM_CACHE
-void stream_enable_cache(stream_t *stream,int size,float prefill_init,float prefill);
+void stream_enable_cache(stream_t *stream,int size,int min,int prefill);
#else
// no cache
#define cache_stream_fill_buffer(x) stream_fill_buffer(x)
More information about the MPlayer-cvslog
mailing list