summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-03 21:34:46 +0200
committerwm4 <wm4@nowhere>2015-06-03 21:34:46 +0200
commit52bd61d698792ea15e4f8c3e117785f137a551e7 (patch)
tree0a0488f312f12e1ba1e249f0b6bec48f3feb7fde /player/command.c
parente40b663da34dbfd774bdba7349da1030f5b62ad0 (diff)
downloadmpv-52bd61d698792ea15e4f8c3e117785f137a551e7.tar.bz2
mpv-52bd61d698792ea15e4f8c3e117785f137a551e7.tar.xz
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/command.c')
-rw-r--r--player/command.c12
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;
}