mirror of
https://github.com/mpv-player/mpv
synced 2024-12-11 09:25:56 +00:00
disable cache if stream->fd<0 (no regular file/pipe but some special thing)
Ross Finlayson <finlayson@live.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7007 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ad0f7f3b26
commit
5aff974339
@ -199,6 +199,13 @@ static void exit_sighandler(int x){
|
||||
int stream_enable_cache(stream_t *stream,int size,int min,int prefill){
|
||||
int ss=(stream->type==STREAMTYPE_VCD)?VCD_SECTOR_DATA:STREAM_BUFFER_SIZE;
|
||||
cache_vars_t* s;
|
||||
|
||||
if (stream->fd < 0) {
|
||||
// The stream has no 'fd' behind it, so is non-cacheable
|
||||
mp_msg(MSGT_CACHE,MSGL_STATUS,"\rThis stream is non-cacheable\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(size<32*1024) size=32*1024; // 32kb min
|
||||
s=cache_init(size,ss);
|
||||
stream->cache_data=s;
|
||||
|
Loading…
Reference in New Issue
Block a user