diff options
author | wm4 <wm4@nowhere> | 2012-08-19 18:07:06 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-09-18 20:58:16 +0200 |
commit | 13482fb397ce6bbcec8a9342015f21d48fb7efe6 (patch) | |
tree | b01882ba084afe0e3e635a3925cc589d913348a9 /mp_core.h | |
parent | 1fb275b7de1f58a14182594996930860295af6c4 (diff) | |
download | mpv-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.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |