From 5d562c5ef299873d104be01ff198d1befda36392 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 14 Apr 2013 02:35:48 +0200 Subject: mplayer: take tracks from first segment if main file is empty With Matroska ordered chapters, the main file (i.e. the file you're playing) can be empty, while all video/audio data is in linked files. Some files don't even contain the track list, only chapter information. mpv refused to play these, because normally, the main file dictates the track layout. Fix this by using the first segment for track data if no part of the timeline is sourced from the main file. --- core/mplayer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index 78c3cae3c5..41fac2adf8 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -3993,10 +3993,16 @@ goto_enable_cache: ; mpctx->demuxer); } - if (mpctx->timeline && !mpctx->demuxer->matroska_data.ordered_chapters) { - // With Matroska, the "master" file dictates track layout etc. - // On the contrary, the EDL and CUE demuxers are empty wrappers. + if (mpctx->timeline) { + // With Matroska, the "master" file usually dictates track layout etc. + // On the contrary, the EDL and CUE demuxers are empty wrappers, as + // well as Matroska ordered chapter playlist-like files. + for (int n = 0; n < mpctx->num_timeline_parts; n++) { + if (mpctx->timeline[n].source == mpctx->demuxer) + goto main_is_ok; + } mpctx->demuxer = mpctx->timeline[0].source; + main_is_ok: ; } add_dvd_tracks(mpctx); add_demuxer_tracks(mpctx, mpctx->demuxer); -- cgit v1.2.3