diff options
author | wm4 <wm4@nowhere> | 2019-12-28 21:32:03 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-12-28 21:32:15 +0100 |
commit | 5a261507173d28c762ba4f605d7983d928d4bf24 (patch) | |
tree | f178d1bfce80e7033232fc353ea292d37be3112f /player/command.c | |
parent | 582f3f7cc01f81345df5c20a012b1f47587e6a97 (diff) | |
download | mpv-5a261507173d28c762ba4f605d7983d928d4bf24.tar.bz2 mpv-5a261507173d28c762ba4f605d7983d928d4bf24.tar.xz |
command: add a playlist-unshuffle command
Has a number of restrictions.
See: #2491, #7294
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index 084fd0fc4e..0a17a1def4 100644 --- a/player/command.c +++ b/player/command.c @@ -4916,6 +4916,15 @@ static void cmd_playlist_shuffle(void *p) mp_notify(mpctx, MP_EVENT_CHANGE_PLAYLIST, NULL); } +static void cmd_playlist_unshuffle(void *p) +{ + struct mp_cmd_ctx *cmd = p; + struct MPContext *mpctx = cmd->mpctx; + + playlist_unshuffle(mpctx->playlist); + mp_notify(mpctx, MP_EVENT_CHANGE_PLAYLIST, NULL); +} + static void cmd_stop(void *p) { struct mp_cmd_ctx *cmd = p; @@ -5629,6 +5638,7 @@ const struct mp_cmd_def mp_cmds[] = { .priv = &(const int){-1}, }, { "playlist-shuffle", cmd_playlist_shuffle, }, + { "playlist-unshuffle", cmd_playlist_unshuffle, }, { "sub-step", cmd_sub_step_seek, { OPT_INT("skip", v.i, 0) }, .allow_auto_repeat = true, .priv = &(const bool){true} }, { "sub-seek", cmd_sub_step_seek, { OPT_INT("skip", v.i, 0) }, |