CVS: main/libmpdemux cache2.c,1.13,1.14
Update of /cvsroot/mplayer/main/libmpdemux In directory mail:/var/tmp.root/cvs-serv21787 Modified Files: cache2.c Log Message: disable cache if stream->fd<0 (no regular file/pipe but some special thing) Ross Finlayson <finlayson@live.com> Index: cache2.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/cache2.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- cache2.c 5 May 2002 21:43:16 -0000 1.13 +++ cache2.c 14 Aug 2002 21:46:48 -0000 1.14 @@ -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;
participants (1)
-
Arpi of Ize