From 098f0c67e630544be6a6f602460904243e283c93 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 13 Feb 2014 13:30:07 +0100 Subject: player: select subtitles added with sub_add In particular, this affects drag & drop of subtitles, which uses sub_add internally. This will make the subtitles show up immediately, instead of requiring manual selection of the added subtitle. Might be not so ideal when adding multiple subtitles at once, because that leads to multiple sub_add commands, and will end up with the last subtitle instead of the first selected. But this is a minor detail. --- player/command.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index 1a0ecaa0c4..410183e28a 100644 --- a/player/command.c +++ b/player/command.c @@ -3025,9 +3025,12 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) break; #endif /* HAVE_TV */ - case MP_CMD_SUB_ADD: - mp_add_subtitles(mpctx, cmd->args[0].v.s); + case MP_CMD_SUB_ADD: { + struct track *sub = mp_add_subtitles(mpctx, cmd->args[0].v.s); + if (sub) + mp_switch_track(mpctx, sub->type, sub); break; + } case MP_CMD_SUB_REMOVE: { struct track *sub = mp_track_by_tid(mpctx, STREAM_SUB, cmd->args[0].v.i); -- cgit v1.2.3