summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-13 13:30:07 +0100
committerwm4 <wm4@nowhere>2014-02-13 13:30:31 +0100
commit098f0c67e630544be6a6f602460904243e283c93 (patch)
tree9cce2d00993bfa6be44a113de199ddd0e36f4a5a /player
parentadfda51e8a55a5c9d6c03fcfb4b9584cf99e47fb (diff)
downloadmpv-098f0c67e630544be6a6f602460904243e283c93.tar.bz2
mpv-098f0c67e630544be6a6f602460904243e283c93.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/command.c7
1 files changed, 5 insertions, 2 deletions
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);