mirror of
https://github.com/mpv-player/mpv
synced 2025-02-21 15:27:00 +00:00
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.
This commit is contained in:
parent
adfda51e8a
commit
098f0c67e6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user