diff options
author | wm4 <wm4@nowhere> | 2013-04-17 18:34:11 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-20 23:28:27 +0200 |
commit | c6b03be894750b4939e79c4a51c11ad0a63589d5 (patch) | |
tree | da98d6ef55c4045b1b0c5785f2dc8e4cfa01dafb /core | |
parent | 018530cb7490600bf1f14bfe7cc93e18321ddce7 (diff) | |
download | mpv-c6b03be894750b4939e79c4a51c11ad0a63589d5.tar.bz2 mpv-c6b03be894750b4939e79c4a51c11ad0a63589d5.tar.xz |
core: display subtitle codec in track listing
Also switch the subrip and subviewer names, which obviously have been
confused.
Diffstat (limited to 'core')
-rw-r--r-- | core/mplayer.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index a7fe7618df..3b6dd3984f 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -275,8 +275,10 @@ static void print_stream(struct MPContext *mpctx, struct track *t, int id) if (t->title) mp_msg(MSGT_CPLAYER, MSGL_INFO, " '%s'", t->title); const char *codec = s ? s->codec : NULL; - if (t->sh_sub) // external subs hack + if (!codec && t->sh_sub) // external subs hack codec = t->sh_sub->gsh->codec; + if (!codec && t->subdata) + codec = t->subdata->codec; mp_msg(MSGT_CPLAYER, MSGL_INFO, " (%s)", codec ? codec : "<unknown>"); if (t->is_external) mp_msg(MSGT_CPLAYER, MSGL_INFO, " (external)"); @@ -908,16 +910,21 @@ struct track *mp_add_subtitles(struct MPContext *mpctx, char *filename, struct ass_track *asst = mp_ass_read_stream(mpctx->ass_library, filename, sub_cp); bool is_native_ass = asst; + const char *codec = NULL; if (!asst) { subd = sub_read_file(filename, fps, &mpctx->opts); if (subd) { + codec = subd->codec; asst = mp_ass_read_subdata(mpctx->ass_library, opts, subd, fps); talloc_free(subd); subd = NULL; } } - if (asst) + if (asst) { sh = sd_ass_create_from_track(asst, is_native_ass, opts); + if (codec) + sh->gsh->codec = codec; + } #endif } else subd = sub_read_file(filename, fps, &mpctx->opts); |