diff options
author | wm4 <wm4@nowhere> | 2013-04-14 02:35:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-20 23:28:23 +0200 |
commit | 5d562c5ef299873d104be01ff198d1befda36392 (patch) | |
tree | 5e40b703794d3a2ffd1a507a2219eaf4adb2afa2 /core/mplayer.c | |
parent | 8133aa4d8a6ad64132b2d529ceb1846c3c852987 (diff) | |
download | mpv-5d562c5ef299873d104be01ff198d1befda36392.tar.bz2 mpv-5d562c5ef299873d104be01ff198d1befda36392.tar.xz |
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.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r-- | core/mplayer.c | 12 |
1 files changed, 9 insertions, 3 deletions
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); |