diff libmpdemux/demuxer.c @ 12835:4235ae5a2d60

cache min fill adjustment, based on patch by Jeremy Huddleston
author iive
date Fri, 16 Jul 2004 20:31:17 +0000
parents aa7216363fd4
children 8639d064d3a1
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Fri Jul 16 17:16:00 2004 +0000
+++ b/libmpdemux/demuxer.c	Fri Jul 16 20:31:17 2004 +0000
@@ -1374,6 +1374,9 @@
 
 extern int hr_mp3_seek;
 
+extern float stream_cache_min_percent;
+extern float stream_cache_prefill_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;
   demuxer_t *vd,*ad = NULL,*sd = NULL;
@@ -1386,8 +1389,8 @@
       return NULL;
     }
     if(audio_stream_cache) {
-      if(!stream_enable_cache(as,audio_stream_cache*1024,audio_stream_cache*1024/5,
-			      audio_stream_cache*1024/20)) {
+      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))) {
 	free_stream(as);
 	mp_msg(MSGT_DEMUXER,MSGL_ERR,"Can't enable audio stream cache\n");
 	return NULL;