diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-14 21:46:48 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-14 21:46:48 +0000 |
commit | 5aff974339c3c9c6bf06957c82bf49473d1a22f4 (patch) | |
tree | de5c0d3eff48826a87dd069a513d3537757c50e2 /libmpdemux | |
parent | ad0f7f3b26876bd16d12d7f9a91c1db7ff5771e6 (diff) | |
download | mpv-5aff974339c3c9c6bf06957c82bf49473d1a22f4.tar.bz2 mpv-5aff974339c3c9c6bf06957c82bf49473d1a22f4.tar.xz |
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
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/cache2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libmpdemux/cache2.c b/libmpdemux/cache2.c index e2fde59e62..4aa65e6045 100644 --- a/libmpdemux/cache2.c +++ b/libmpdemux/cache2.c @@ -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; |