summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-08-19 15:31:38 +0200
committerwm4 <wm4@nowhere>2012-09-18 21:07:30 +0200
commit70e7d63ba011a326f5e03137b8fb45df222c43af (patch)
tree7537f596d739f09837f43cf7078cd46bda265527 /stream/stream.h
parent1959ba006ce1a4591f3dcd5093901993e3fdda5f (diff)
downloadmpv-70e7d63ba011a326f5e03137b8fb45df222c43af.tar.bz2
mpv-70e7d63ba011a326f5e03137b8fb45df222c43af.tar.xz
core, timeline: cache external ordered chapter files too
Previously, Matroska source files other than the initially opened one were always accessed without caching. Enable cache for extra files too. A separate cache process/thread is started for each file, which is less than optimal but probably better than no caching if the user explicitly enabled cache. This commit only implements caching for Matroska ordered chapters (not for EDL timeline). To build the timeline we need to demux the files in the current directory to look for segments with matching uuid. This first demux is done with no cache since we don't need to read a lot of the stream. If the file is recognized as one of the needed sources it's reopened with cache enabled. Also move the stream_cache_size global variable to the options struct. Conflicts: cfg-mplayer.h mplayer.c stream/stream.h timeline/tl_matroska.c
Diffstat (limited to 'stream/stream.h')
-rw-r--r--stream/stream.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/stream/stream.h b/stream/stream.h
index eeb2f769bd..0cee8498eb 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -184,6 +184,8 @@ int stream_fill_buffer(stream_t *s);
int stream_seek_long(stream_t *s, off_t pos);
#ifdef CONFIG_STREAM_CACHE
+int stream_enable_cache_percent(stream_t *stream, int64_t stream_cache_size,
+ float stream_cache_min_percent, float stream_cache_seek_min_percent);
int stream_enable_cache(stream_t *stream,int64_t size,int64_t min,int64_t prefill);
int cache_stream_fill_buffer(stream_t *s);
int cache_stream_seek_long(stream_t *s,int64_t pos);
@@ -192,6 +194,7 @@ int cache_stream_seek_long(stream_t *s,int64_t pos);
#define cache_stream_fill_buffer(x) stream_fill_buffer(x)
#define cache_stream_seek_long(x,y) stream_seek_long(x,y)
#define stream_enable_cache(x,y,z,w) 1
+#define stream_enable_cache_percent(x,y,z,w) 1
#endif
int stream_write_buffer(stream_t *s, unsigned char *buf, int len);