summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-10 05:07:36 +0100
committeravih <avih@users.noreply.github.com>2017-12-10 06:37:49 +0200
commitb782c901809a47dddadc33368d66d88d1bd9e9b9 (patch)
treef6fba66eff401aebf21c681c4982419667e42eff /demux/demux.h
parent451a502c1d15ad2c1b60a141c969be06fa10d152 (diff)
downloadmpv-b782c901809a47dddadc33368d66d88d1bd9e9b9.tar.bz2
mpv-b782c901809a47dddadc33368d66d88d1bd9e9b9.tar.xz
demux_timeline: disable pointless packet cache for sub-demuxers
It seems like there's nothing stopping from sub-demuxers from keeping packets in the cache, even if it's completely pointless. The top-most demuxer (demux_timeline) already takes care of caching, so sub-demuxers only waste space and time with this. Add a function that can disable the packet cache even at runtime and after packets are read. (It's not clear whether it really can happen that packets are read before demux_timeline gets the sub-demuxers, but there's no reason to make it too fragile.) Call it on all sub-demuxers. For this to work, it seems we have to move the code for setting the seekable_cache flag to before demux_timeline is potentially initialized, because otherwise the cache would be reenabled if the demuxer triggering timeline support is a timeline segment itself (e.g. ordered chapters).
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/demux/demux.h b/demux/demux.h
index 9224ca3a98..aeabd36e99 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -298,6 +298,8 @@ int demux_stream_control(demuxer_t *demuxer, int ctrl, void *arg);
void demux_changed(demuxer_t *demuxer, int events);
void demux_update(demuxer_t *demuxer);
+void demux_disable_cache(demuxer_t *demuxer);
+
struct sh_stream *demuxer_stream_by_demuxer_id(struct demuxer *d,
enum stream_type t, int id);