summaryrefslogtreecommitdiffstats
path: root/player/client.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-09 10:59:09 +0200
committerwm4 <wm4@nowhere>2016-09-09 12:27:41 +0200
commitea94b01e6b39857028b5511ffb2d42ca491cf111 (patch)
treedac7625acc93aada9b075800ea4b00ccf146e716 /player/client.c
parent5e30e7a04125e3c503160a76bbfe9361bff561fd (diff)
downloadmpv-ea94b01e6b39857028b5511ffb2d42ca491cf111.tar.bz2
mpv-ea94b01e6b39857028b5511ffb2d42ca491cf111.tar.xz
client API: make mpv_opengl_cb_uninit_gl() behavior slightly nicer
Instead of deselecting the video stream plainly, use the slightly more robust error_on_track() function. Also give it an error code (although I'm not sure if this one is confusing, it's better than the one before).
Diffstat (limited to 'player/client.c')
-rw-r--r--player/client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/player/client.c b/player/client.c
index ac89d3a141..c17c4e27cf 100644
--- a/player/client.c
+++ b/player/client.c
@@ -1666,8 +1666,12 @@ 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, 0);
+ struct track *track = mpctx->vo_chain ? mpctx->vo_chain->track : NULL;
uninit_video_out(mpctx);
+ if (track) {
+ mpctx->error_playing = MPV_ERROR_VO_INIT_FAILED;
+ error_on_track(mpctx, track);
+ }
mp_dispatch_unlock(mpctx->dispatch);
}