summaryrefslogtreecommitdiffstats
path: root/mp_core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-19 18:07:06 +0200
committerwm4 <wm4@nowhere>2012-09-18 20:58:16 +0200
commit13482fb397ce6bbcec8a9342015f21d48fb7efe6 (patch)
treeb01882ba084afe0e3e635a3925cc589d913348a9 /mp_core.h
parent1fb275b7de1f58a14182594996930860295af6c4 (diff)
downloadmpv-13482fb397ce6bbcec8a9342015f21d48fb7efe6.tar.bz2
mpv-13482fb397ce6bbcec8a9342015f21d48fb7efe6.tar.xz
core: refactor MPContext.demuxer field accesses
Whenever the demuxer is accessed to retrieve metadata, use the newly introduced master_demuxer field instead. If a timeline is used, the master_demuxer will still refer to the main file, instead to segments. Instead of mpctx->demuxer->stream, access mpctx->stream; even though they are the same, the code becomes shorter. For the TV code, introduce a function get_tvh() to access the TV handle, instead of duplicating the code all over the place. Often the demuxer field is checked to determine whether something is currently played; prefer other methods over that. Note that the code before always accessed the current timeline segment, and would e.g. read file metadata of the current segment. Now it always returns metadata for the master file. This may have various wanted and unwanted effects.
Diffstat (limited to 'mp_core.h')
-rw-r--r--mp_core.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/mp_core.h b/mp_core.h
index 47d7d6cbbb..6eea692acd 100644
--- a/mp_core.h
+++ b/mp_core.h
@@ -115,6 +115,11 @@ typedef struct MPContext {
struct demux_stream *d_audio;
struct demux_stream *d_video;
struct demux_stream *d_sub;
+
+ // Uses: accessing metadata (consider ordered chapters case, where the main
+ // demuxer defines metadata), or special purpose demuxers like TV.
+ struct demuxer *master_demuxer;
+
mixer_t mixer;
struct ao *ao;
struct vo *video_out;