summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-26 18:32:27 +0100
committerwm4 <wm4@nowhere>2015-12-26 18:32:27 +0100
commitce8524cb479f3b3339c6d2b3e0f5a45051145204 (patch)
treef82095783f5762c3229f6d7b71a029b794bf1efa /player/core.h
parent504286b00689ad2c436bdd230b5a63cd66ba8cd6 (diff)
downloadmpv-ce8524cb479f3b3339c6d2b3e0f5a45051145204.tar.bz2
mpv-ce8524cb479f3b3339c6d2b3e0f5a45051145204.tar.xz
sub: cache subtitle state per track instead of per demuxer stream
Since commit 6d9cb893, subtitle state doesn't survive timeline switches (ordered chapters etc.). So there is no point in caching the state per sh_stream anymore (which would be required to deal with multiple segments). Move the cache to struct track. (Whether it's worth caching the subtitle state just for the situation when subtitle tracks get reselected is questionable. But for now, it's nice to have the subtitles immediately show up when reselecting a subtitle.)
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/core.h b/player/core.h
index db453e097e..1d68019c1a 100644
--- a/player/core.h
+++ b/player/core.h
@@ -139,6 +139,9 @@ struct track {
// Invariant: !stream || stream->demuxer == demuxer
struct sh_stream *stream;
+ // Current subtitle state (or cached state if selected==false).
+ struct dec_sub *dec_sub;
+
// For external subtitles, which are read fully on init. Do not attempt
// to read packets from them.
bool preloaded;
@@ -517,7 +520,6 @@ void mp_load_scripts(struct MPContext *mpctx);
// sub.c
void reset_subtitle_state(struct MPContext *mpctx);
-void uninit_stream_sub_decoders(struct demuxer *demuxer);
void reinit_subs(struct MPContext *mpctx, int order);
void uninit_sub(struct MPContext *mpctx, int order);
void uninit_sub_all(struct MPContext *mpctx);