From 52bd61d698792ea15e4f8c3e117785f137a551e7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 3 Jun 2015 21:34:46 +0200 Subject: player: don't print stream list when adding external tracks during load There's a short time during loading where external commands can add external streams even before the main file is loaded (like during ytdl hook execution). The track list is printed every time an external track is added via commands. This was quite awkward when ytdl was adding multiple streams, so don't print it in this stage. They are printed anyway at the end of the loading process. --- player/command.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index b95343712c..7715cfb0d3 100644 --- a/player/command.c +++ b/player/command.c @@ -4547,8 +4547,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re return -1; int type = cmd->id == MP_CMD_SUB_ADD ? STREAM_SUB : STREAM_AUDIO; if (cmd->args[1].v.i == 2) { - struct track *t = find_track_with_url(mpctx, type, - cmd->args[0].v.s); + struct track *t = find_track_with_url(mpctx, type, cmd->args[0].v.s); if (t) { mp_switch_track(mpctx, t->type, t, FLAG_MARK_SELECTION); return 0; @@ -4568,7 +4567,8 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re char *lang = cmd->args[3].v.s; if (lang && lang[0]) t->lang = talloc_strdup(t, lang); - print_track_list(mpctx); + if (mpctx->playback_initialized) + print_track_list(mpctx); break; } @@ -4579,7 +4579,8 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re if (!t) return -1; mp_remove_track(mpctx, t); - print_track_list(mpctx); + if (mpctx->playback_initialized) + print_track_list(mpctx); break; } @@ -4615,7 +4616,8 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re if (s && s->is_external) mp_switch_track(mpctx, STREAM_SUB, s, 0); - print_track_list(mpctx); + if (mpctx->playback_initialized) + print_track_list(mpctx); } break; } -- cgit v1.2.3