summaryrefslogtreecommitdiffstats
path: root/player/client.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-26 14:01:23 +0200
committerwm4 <wm4@nowhere>2015-05-26 14:01:23 +0200
commit88249baf5bb66e164b17bc53e10441c3c3111e45 (patch)
tree0157e34bc549da73fdcd08a7c8c1b8666d8afad0 /player/client.c
parentbdcd25d3c23b49704f3abe78dc0c523f20a71d45 (diff)
downloadmpv-88249baf5bb66e164b17bc53e10441c3c3111e45.tar.bz2
mpv-88249baf5bb66e164b17bc53e10441c3c3111e45.tar.xz
player: fix crashes when adding external tracks before loading main file
Adding an external audio track before loading the main file didn't work right. For one, mp_switch_track() assumes it is called after the main file is loaded. (The difference is that decoders are only initialized once the main file is loaded, and we avoid doing this before that for whatever reason.) To avoid further messiness, just allow mp_switch_track() to be called at any time. Also make it do what mp_mark_user_track_selection() did, since the latter requires current_track to be set. (One could probably simply allow current_track to be set at this point, but it'd interfere with default track selection anyway and thus would be pointless.) Fixes #1984.
Diffstat (limited to 'player/client.c')
-rw-r--r--player/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/client.c b/player/client.c
index afc4f32a68..8fb2d6f768 100644
--- a/player/client.c
+++ b/player/client.c
@@ -1664,7 +1664,7 @@ void kill_video(struct mp_client_api *client_api)
{
struct MPContext *mpctx = client_api->mpctx;
mp_dispatch_lock(mpctx->dispatch);
- mp_switch_track(mpctx, STREAM_VIDEO, NULL);
+ mp_switch_track(mpctx, STREAM_VIDEO, NULL, 0);
uninit_video_out(mpctx);
mp_dispatch_unlock(mpctx->dispatch);
}