From af5c393d2c0b508b0fbd68f18fb9d0b4f34c61ca Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 23 Jan 2014 00:54:08 +0100 Subject: demux_mkv: nicer edition output If there's more than one edition, print the list of editions, including the edition name, whether the edition is selected, whether the edition is default, and the command line option to select the edition. (Similar to stream list.) Move reading the tags to a separate function process_tags(), which is called when all other state is parsed. Otherwise, that tags will be lost if chapters are read after the tags. --- player/loadfile.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'player') diff --git a/player/loadfile.c b/player/loadfile.c index d673a176c2..9116a0c0df 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -263,9 +263,19 @@ static void print_file_properties(struct MPContext *mpctx) } } struct demuxer *demuxer = mpctx->master_demuxer; - if (demuxer->num_editions > 1) - MP_INFO(mpctx, "Playing edition %d of %d (--edition=%d).\n", - demuxer->edition + 1, demuxer->num_editions, demuxer->edition); + if (demuxer->num_editions > 1) { + for (int n = 0; n < demuxer->num_editions; n++) { + struct demux_edition *edition = &demuxer->editions[n]; + MP_INFO(mpctx, "[edition] %3s --edition=%d", + n == demuxer->edition ? "(+)" : "", n); + char *name = mp_tags_get_str(edition->metadata, "title"); + if (name) + MP_INFO(mpctx, " '%s'", name); + if (edition->default_edition) + MP_INFO(mpctx, " (*)"); + MP_INFO(mpctx, "\n"); + } + } for (int t = 0; t < STREAM_TYPE_COUNT; t++) { for (int n = 0; n < mpctx->num_tracks; n++) if (mpctx->tracks[n]->type == t) -- cgit v1.2.3