diff options
author | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-21 10:47:47 +0000 |
---|---|---|
committer | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-21 10:47:47 +0000 |
commit | f45bfe505d9d245aecc5f79ad96ecbd333bacefa (patch) | |
tree | d9c859d30e9696f16b2fe9653757cff16e513695 /libmpdemux/network.c | |
parent | 5fafd19ee28c13e90f1af33db15480ed2a42324f (diff) | |
download | mpv-f45bfe505d9d245aecc5f79ad96ecbd333bacefa.tar.bz2 mpv-f45bfe505d9d245aecc5f79ad96ecbd333bacefa.tar.xz |
Add a check to not set the cache size if the user alredy set it.
Use m_config_set_int in place of m_config_set_option.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4294 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/network.c')
-rw-r--r-- | libmpdemux/network.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libmpdemux/network.c b/libmpdemux/network.c index 44bc396f19..3110691f39 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -711,18 +711,19 @@ streaming_start(stream_t *stream, int demuxer_type, URL_t *url) { if( ret<0 ) { streaming_ctrl_free( stream->streaming_ctrl ); stream->streaming_ctrl = NULL; - } else if( stream->streaming_ctrl->buffering ) { - char cache_size[10]; - int ret=-1; - // buffer in KBytes, *5 because the prefill is 20% of the buffer. - sprintf( cache_size, "%d", (stream->streaming_ctrl->prebuffer_size/1024)*5 ); -printf("Cache size = %s KBytes\n", cache_size ); - ret = m_config_set_option(mconfig, "cache", cache_size ); - if( ret<0 ) { - printf("Unable to set the cache size option (return=%d)\n", ret ); - } else { - printf("Cache size set to %s KBytes\n", cache_size ); - } + } else if( stream->streaming_ctrl->buffering) { + int ret; + ret = m_config_is_option_set(mconfig,"cache"); + if(ret < 0) { + printf("Unable to know if cache size option was set\n"); + } else if(!ret) { + // buffer in KBytes, *5 because the prefill is 20% of the buffer. + if(m_config_set_int(mconfig,"cache",(stream->streaming_ctrl->prebuffer_size/1024)*5)) + printf("Cache size set to %d KBytes\n",(stream->streaming_ctrl->prebuffer_size/1024)*5); + else + printf("Unable to set the cache size option\n"); + } else + printf("Cache size alredy set\n"); } return ret; } |