# HG changeset patch # User arpi # Date 1035410849 0 # Node ID aba9301ed3c4d1889fd2be27c5dd32c7b9c2e819 # Parent 5bb4d8801a2c64ff4d11f6c5ac70e2915f0f77b0 allow cache to be disabled (-nocache should override cachesize autodetection in stream layer) diff -r 5bb4d8801a2c -r aba9301ed3c4 libmpdemux/network.c --- a/libmpdemux/network.c Wed Oct 23 20:39:49 2002 +0000 +++ b/libmpdemux/network.c Wed Oct 23 22:07:29 2002 +0000 @@ -885,7 +885,7 @@ stream->streaming_ctrl = NULL; } else if( stream->streaming_ctrl->buffering ) { int cache_size = stream_cache_size; - if(!stream_cache_size) { + if(stream_cache_size<0) { // cache option not set, will use our computed value. // buffer in KBytes, *5 because the prefill is 20% of the buffer. stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5; diff -r 5bb4d8801a2c -r aba9301ed3c4 mencoder.c --- a/mencoder.c Wed Oct 23 20:39:49 2002 +0000 +++ b/mencoder.c Wed Oct 23 22:07:29 2002 +0000 @@ -77,7 +77,7 @@ //-------------------------- // cache2: -int stream_cache_size=0; +int stream_cache_size=-1; #ifdef USE_STREAM_CACHE extern int cache_fill_status; #else @@ -446,7 +446,7 @@ } #endif - if(stream_cache_size) stream_enable_cache(stream,stream_cache_size*1024,0,0); + if(stream_cache_size>0) stream_enable_cache(stream,stream_cache_size*1024,0,0); if(demuxer2) audio_id=-2; /* do NOT read audio packets... */ diff -r 5bb4d8801a2c -r aba9301ed3c4 mplayer.c --- a/mplayer.c Wed Oct 23 20:39:49 2002 +0000 +++ b/mplayer.c Wed Oct 23 22:07:29 2002 +0000 @@ -194,7 +194,7 @@ char* filename=NULL; //"MI2-Trailer.avi"; // cache2: - int stream_cache_size=0; + int stream_cache_size=-1; #ifdef USE_STREAM_CACHE extern int cache_fill_status; #else @@ -977,7 +977,7 @@ #endif // CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts) -if(stream_cache_size){ +if(stream_cache_size>0){ current_module="enable_cache"; if(!stream_enable_cache(stream,stream_cache_size*1024,stream_cache_size*1024/5,stream_cache_size*1024/20)) if((eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY))) goto goto_next_file;