# HG changeset patch # User arpi # Date 1029361608 0 # Node ID c0b490505298fa5450a5128da427e9b9a6ea1b63 # Parent 40c596e6552606066eecf35001641c85b57ba2e5 disable cache if stream->fd<0 (no regular file/pipe but some special thing) Ross Finlayson diff -r 40c596e65526 -r c0b490505298 libmpdemux/cache2.c --- a/libmpdemux/cache2.c Wed Aug 14 21:44:56 2002 +0000 +++ b/libmpdemux/cache2.c Wed Aug 14 21:46:48 2002 +0000 @@ -199,6 +199,13 @@ 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;