summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/command.c')
-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);