mirror of https://github.com/mpv-player/mpv
allow cache to be disabled (-nocache should override cachesize autodetection
in stream layer) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7882 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e6ebe2824e
commit
12bf06a1ad
|
@ -885,7 +885,7 @@ streaming_start(stream_t *stream, int *demuxer_type, URL_t *url) {
|
||||||
stream->streaming_ctrl = NULL;
|
stream->streaming_ctrl = NULL;
|
||||||
} else if( stream->streaming_ctrl->buffering ) {
|
} else if( stream->streaming_ctrl->buffering ) {
|
||||||
int cache_size = stream_cache_size;
|
int cache_size = stream_cache_size;
|
||||||
if(!stream_cache_size) {
|
if(stream_cache_size<0) {
|
||||||
// cache option not set, will use our computed value.
|
// cache option not set, will use our computed value.
|
||||||
// buffer in KBytes, *5 because the prefill is 20% of the buffer.
|
// buffer in KBytes, *5 because the prefill is 20% of the buffer.
|
||||||
stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5;
|
stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5;
|
||||||
|
|
|
@ -77,7 +77,7 @@ int vo_config_count=0;
|
||||||
//--------------------------
|
//--------------------------
|
||||||
|
|
||||||
// cache2:
|
// cache2:
|
||||||
int stream_cache_size=0;
|
int stream_cache_size=-1;
|
||||||
#ifdef USE_STREAM_CACHE
|
#ifdef USE_STREAM_CACHE
|
||||||
extern int cache_fill_status;
|
extern int cache_fill_status;
|
||||||
#else
|
#else
|
||||||
|
@ -446,7 +446,7 @@ if(stream->type==STREAMTYPE_DVD){
|
||||||
}
|
}
|
||||||
#endif
|
#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... */
|
if(demuxer2) audio_id=-2; /* do NOT read audio packets... */
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ int vcd_track=0;
|
||||||
char* filename=NULL; //"MI2-Trailer.avi";
|
char* filename=NULL; //"MI2-Trailer.avi";
|
||||||
|
|
||||||
// cache2:
|
// cache2:
|
||||||
int stream_cache_size=0;
|
int stream_cache_size=-1;
|
||||||
#ifdef USE_STREAM_CACHE
|
#ifdef USE_STREAM_CACHE
|
||||||
extern int cache_fill_status;
|
extern int cache_fill_status;
|
||||||
#else
|
#else
|
||||||
|
@ -977,7 +977,7 @@ if(stream->type==STREAMTYPE_DVD){
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts)
|
// CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts)
|
||||||
if(stream_cache_size){
|
if(stream_cache_size>0){
|
||||||
current_module="enable_cache";
|
current_module="enable_cache";
|
||||||
if(!stream_enable_cache(stream,stream_cache_size*1024,stream_cache_size*1024/5,stream_cache_size*1024/20))
|
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;
|
if((eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY))) goto goto_next_file;
|
||||||
|
|
Loading…
Reference in New Issue