diff options
author | Tom Wilson <twilson90@hotmail.co.uk> | 2021-02-26 11:05:24 +0000 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2021-03-09 23:28:21 +0200 |
commit | d7f6eba233369904ab1fa1ccd0f943bcf2fbc6e9 (patch) | |
tree | 7b7006356283bd126263117b8e194d487df391de /player/command.c | |
parent | eef281e89eff6e21a67a106d27fd38979ad20752 (diff) | |
download | mpv-d7f6eba233369904ab1fa1ccd0f943bcf2fbc6e9.tar.bz2 mpv-d7f6eba233369904ab1fa1ccd0f943bcf2fbc6e9.tar.xz |
player/command: add albumart argument to video-add
Enables marking of specific video sources as album art.
Co-authored-by: Jan Ekström <jeebjp@gmail.com>
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index 96e5daef77..e210963447 100644 --- a/player/command.c +++ b/player/command.c @@ -5241,6 +5241,8 @@ static void cmd_track_add(void *p) struct mp_cmd_ctx *cmd = p; struct MPContext *mpctx = cmd->mpctx; int type = *(int *)cmd->priv; + bool is_albumart = type == STREAM_VIDEO && + cmd->args[4].v.i; if (mpctx->stop_play) { cmd->success = false; @@ -5260,7 +5262,7 @@ static void cmd_track_add(void *p) } } int first = mp_add_external_file(mpctx, cmd->args[0].v.s, type, - cmd->abort->cancel, false); + cmd->abort->cancel, is_albumart); if (first < 0) { cmd->success = false; return; @@ -5323,9 +5325,10 @@ static void cmd_track_reload(void *p) if (t && t->is_external && t->external_filename) { char *filename = talloc_strdup(NULL, t->external_filename); + bool is_albumart = t->attached_picture; mp_remove_track(mpctx, t); nt_num = mp_add_external_file(mpctx, filename, type, cmd->abort->cancel, - false); + is_albumart); talloc_free(filename); } @@ -6072,6 +6075,7 @@ const struct mp_cmd_def mp_cmds[] = { .flags = MP_CMD_OPT_ARG}, {"title", OPT_STRING(v.s), .flags = MP_CMD_OPT_ARG}, {"lang", OPT_STRING(v.s), .flags = MP_CMD_OPT_ARG}, + {"albumart", OPT_FLAG(v.i), .flags = MP_CMD_OPT_ARG}, }, .priv = &(const int){STREAM_VIDEO}, .spawn_thread = true, |