mirror of
https://github.com/mpv-player/mpv
synced 2024-11-18 21:16:10 +01:00
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).
This commit is contained in:
parent
5e30e7a041
commit
ea94b01e6b
@ -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);
|
||||
}
|
||||
|
||||
|
@ -410,6 +410,10 @@ int init_video_decoder(struct MPContext *mpctx, struct track *track)
|
||||
d_video->header = track->stream;
|
||||
d_video->codec = track->stream->codec;
|
||||
d_video->fps = d_video->header->codec->fps;
|
||||
|
||||
// Note: at least mpv_opengl_cb_uninit_gl() relies on being able to get
|
||||
// rid of all references to the VO by destroying the VO chain. Thus,
|
||||
// decoders not linked to vo_chain must not use the hwdec context.
|
||||
if (mpctx->vo_chain)
|
||||
d_video->hwdec_devs = mpctx->vo_chain->hwdec_devs;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user