diff options
author | wm4 <wm4@nowhere> | 2018-05-07 20:36:17 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2018-05-24 19:56:34 +0200 |
commit | 1b611e38ef9291c309e97379ef432fd301605033 (patch) | |
tree | 95034a0442af61b6df9bb753029a2a67a299e31a /player/command.c | |
parent | 115a9b19f14e0e8cc6dd5d0732cd39322cbd686c (diff) | |
download | mpv-1b611e38ef9291c309e97379ef432fd301605033.tar.bz2 mpv-1b611e38ef9291c309e97379ef432fd301605033.tar.xz |
player: make all external file loading actions async
Still missing: not freezing when removing a track (i.e. closing demuxer)
with the sub-remove/audio-remove/rescan-external-files commands.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c index 9aa3a9e6d8..12c232640a 100644 --- a/player/command.c +++ b/player/command.c @@ -5520,7 +5520,7 @@ static void cmd_track_add(void *p) return; } } - int first = mp_add_external_file(mpctx, cmd->args[0].v.s, type, true); + int first = mp_add_external_file(mpctx, cmd->args[0].v.s, type); if (first < 0) { cmd->success = false; return; @@ -5584,7 +5584,7 @@ static void cmd_track_reload(void *p) if (t && t->is_external && t->external_filename) { char *filename = talloc_strdup(NULL, t->external_filename); mp_remove_track(mpctx, t); - nt_num = mp_add_external_file(mpctx, filename, type, false); + nt_num = mp_add_external_file(mpctx, filename, type); talloc_free(filename); } @@ -6044,7 +6044,9 @@ const struct mp_cmd_def mp_cmds[] = { { "sub-remove", cmd_track_remove, { OARG_INT(-1) }, .priv = &(const int){STREAM_SUB}, }, { "sub-reload", cmd_track_reload, { OARG_INT(-1) }, - .priv = &(const int){STREAM_SUB}, }, + .priv = &(const int){STREAM_SUB}, + .spawn_thread = true, + }, { "tv-last-channel", cmd_tv_last_channel, }, @@ -6175,12 +6177,16 @@ const struct mp_cmd_def mp_cmds[] = { { "audio-remove", cmd_track_remove, { OARG_INT(-1) }, .priv = &(const int){STREAM_AUDIO}, }, { "audio-reload", cmd_track_reload, { OARG_INT(-1) }, - .priv = &(const int){STREAM_AUDIO}, }, + .priv = &(const int){STREAM_AUDIO}, + .spawn_thread = true, + }, { "rescan-external-files", cmd_rescan_external_files, { OARG_CHOICE(1, ({"keep-selection", 0}, {"reselect", 1})), - }}, + }, + .spawn_thread = true, + }, { "apply-profile", cmd_apply_profile, {ARG_STRING } }, |