diff options
author | wm4 <wm4@nowhere> | 2015-06-03 21:34:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-03 21:34:46 +0200 |
commit | 52bd61d698792ea15e4f8c3e117785f137a551e7 (patch) | |
tree | 0a0488f312f12e1ba1e249f0b6bec48f3feb7fde /player | |
parent | e40b663da34dbfd774bdba7349da1030f5b62ad0 (diff) |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |