From 9ccb1739b2df3925d78a977b988ba666dd5bccb6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 May 2013 00:32:38 +0200 Subject: mplayer: re-add some legacy slave mode output for issue #92 In the long run this should be done differently. ID_... output sucks. This commit will be reverted as soon as I have a good idea how this should be done properly. --- core/mplayer.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'core/mplayer.c') diff --git a/core/mplayer.c b/core/mplayer.c index a0b18cab62..6a2a530469 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -252,21 +252,22 @@ static double get_play_end_pts(struct MPContext *mpctx) return MP_NOPTS_VALUE; } -static void print_stream(struct MPContext *mpctx, struct track *t, int id) +static void print_stream(struct MPContext *mpctx, struct track *t) { struct sh_stream *s = t->stream; const char *tname = "?"; const char *selopt = "?"; const char *langopt = "?"; + const char *iid = NULL; switch (t->type) { case STREAM_VIDEO: - tname = "Video"; selopt = "vid"; langopt = NULL; + tname = "Video"; selopt = "vid"; langopt = NULL; iid = "VID"; break; case STREAM_AUDIO: - tname = "Audio"; selopt = "aid"; langopt = "alang"; + tname = "Audio"; selopt = "aid"; langopt = "alang"; iid = "AID"; break; case STREAM_SUB: - tname = "Subs"; selopt = "sid"; langopt = "slang"; + tname = "Subs"; selopt = "sid"; langopt = "slang"; iid = "SID"; break; } mp_msg(MSGT_CPLAYER, MSGL_INFO, "[stream] %-5s %3s", @@ -289,6 +290,15 @@ static void print_stream(struct MPContext *mpctx, struct track *t, int id) if (t->is_external) mp_msg(MSGT_CPLAYER, MSGL_INFO, " (external)"); mp_msg(MSGT_CPLAYER, MSGL_INFO, "\n"); + // legacy compatibility + if (!iid) + return; + int id = t->user_tid; + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_%s_ID=%d\n", iid, id); + if (t->title) + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_%s_%d_NAME=%s\n", iid, id, t->title); + if (t->lang) + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_%s_%d_LANG=%s\n", iid, id, t->lang); } static void print_file_properties(struct MPContext *mpctx, const char *filename) @@ -369,7 +379,7 @@ static void print_file_properties(struct MPContext *mpctx, const char *filename) for (int t = 0; t < STREAM_TYPE_COUNT; t++) { for (int n = 0; n < mpctx->num_tracks; n++) if (mpctx->tracks[n]->type == t) - print_stream(mpctx, mpctx->tracks[n], n); + print_stream(mpctx, mpctx->tracks[n]); } } -- cgit v1.2.3