[MPlayer-cvslog] CVS: main/libmpdemux cache2.c, 1.26, 1.27 demuxer.c, 1.194, 1.195

Ivan Kalvachev CVS syncmail at mplayerhq.hu
Sun Jul 31 02:26:10 CEST 2005


CVS change done by Ivan Kalvachev CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv4340/libmpdemux

Modified Files:
	cache2.c demuxer.c 
Log Message:
remove unused cache-prefill and create cache-seek-min that controls when seek_long is prefered over waiting for cache to fill


Index: cache2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cache2.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- cache2.c	26 Jul 2004 22:06:30 -0000	1.26
+++ cache2.c	31 Jul 2005 00:26:07 -0000	1.27
@@ -42,7 +42,7 @@
   int sector_size; // size of a single sector (2048/2324)
   int back_size;   // we should keep back_size amount of old bytes for backward seek
   int fill_limit;  // we should fill buffer only if space>=fill_limit
-  int prefill;	   // we should fill min prefill bytes if cache gets empty
+  int seek_limit;  // keep filling cache if distanse is less that seek limit
   // filler's pointers:
   int eof;
   off_t min_filepos; // buffer contain only a part of the file, from min-max pos
@@ -122,7 +122,7 @@
       mp_msg(MSGT_CACHE,MSGL_DBG2,"Out of boundaries... seeking to 0x%X  \n",read);
       // 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)
+          read<s->min_filepos || read>=s->max_filepos+s->seek_limit)
       {
         s->offset= // FIXME!?
         s->min_filepos=s->max_filepos=read; // drop cache content :(
@@ -250,7 +250,7 @@
   exit(0);
 }
 
-int stream_enable_cache(stream_t *stream,int size,int min,int prefill){
+int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
   int ss=(stream->type==STREAMTYPE_VCD)?VCD_SECTOR_DATA:STREAM_BUFFER_SIZE;
   cache_vars_t* s;
 
@@ -264,13 +264,13 @@
   if(s == NULL) return 0;
   stream->cache_data=s;
   s->stream=stream; // callback
-  s->prefill=prefill;
+  s->seek_limit=seek_limit;
 
 
   //make sure that we won't wait from cache_fill
   //more data than it is alowed to fill
-  if (s->prefill > s->buffer_size - s->fill_limit ){
-     s->prefill = s->buffer_size - s->fill_limit;
+  if (s->seek_limit > s->buffer_size - s->fill_limit ){
+     s->seek_limit = s->buffer_size - s->fill_limit;
   }
   if (min > s->buffer_size - s->fill_limit) {
      min = s->buffer_size - s->fill_limit;

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -r1.194 -r1.195
--- demuxer.c	10 Jul 2005 17:14:12 -0000	1.194
+++ demuxer.c	31 Jul 2005 00:26:07 -0000	1.195
@@ -1375,7 +1375,7 @@
 extern int hr_mp3_seek;
 
 extern float stream_cache_min_percent;
-extern float stream_cache_prefill_percent;
+extern float stream_cache_seek_min_percent;
 
 demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id,char* filename){
   stream_t *as = NULL,*ss = NULL;
@@ -1392,7 +1392,7 @@
     }
     if(audio_stream_cache) {
       if(!stream_enable_cache(as,audio_stream_cache*1024,audio_stream_cache*1024*(stream_cache_min_percent / 100.0),
-			      audio_stream_cache*1024*(stream_cache_prefill_percent / 100.0))) {
+			      audio_stream_cache*1024*(stream_cache_seek_min_percent / 100.0))) {
 	free_stream(as);
 	mp_msg(MSGT_DEMUXER,MSGL_ERR,"Can't enable audio stream cache\n");
 	return NULL;




More information about the MPlayer-cvslog mailing list