summaryrefslogtreecommitdiffstats
path: root/player/timeline/tl_matroska.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-04 21:20:41 +0100
committerwm4 <wm4@nowhere>2015-02-04 23:04:21 +0100
commit59dc351772e95742600979886591401923aceb25 (patch)
treec601df794f0fea14f2ffd1e98e9c7809ee8605c5 /player/timeline/tl_matroska.c
parentf8dc5db315ce3ec3c3e9c8532f1290967bbe2336 (diff)
downloadmpv-59dc351772e95742600979886591401923aceb25.tar.bz2
mpv-59dc351772e95742600979886591401923aceb25.tar.xz
player: move timeline specific handling to timeline loaders
In particular, gets rid of the Matroska specifics from the common code.
Diffstat (limited to 'player/timeline/tl_matroska.c')
-rw-r--r--player/timeline/tl_matroska.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/player/timeline/tl_matroska.c b/player/timeline/tl_matroska.c
index e2c721a003..8ced0ca7ac 100644
--- a/player/timeline/tl_matroska.c
+++ b/player/timeline/tl_matroska.c
@@ -569,4 +569,14 @@ void build_ordered_chapter_timeline(struct MPContext *mpctx)
mpctx->num_timeline_parts = part_count - 1;
mpctx->num_chapters = m->num_ordered_chapters;
mpctx->chapters = chapters;
+
+ // With Matroska, the "master" file usually dictates track layout etc.,
+ // except maybe with playlist-like files.
+ mpctx->track_layout = mpctx->timeline[0].source;
+ for (int n = 0; n < mpctx->num_timeline_parts; n++) {
+ if (mpctx->timeline[n].source == mpctx->demuxer) {
+ mpctx->track_layout = mpctx->demuxer;
+ break;
+ }
+ }
}