From af103aebd73609fa143b07805082a23525c8a306 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Aug 2016 14:46:38 +0200 Subject: player: update Windows playback state asynchronously Doing this required synchronizing with the VO thread, which could lead to audio dropouts if the VO was frozen (which can happen in practice if e.g. an opengl_cb user is not doing what the API demands). Add a way to send asynchronous VOCTRLs, and use that for the playback state. In theory, it would be better to make this status update a several function and to "merge" several queued update, but that would be slightly more effort/code, and the update is so infrequent that the merging would never happen anyway. The change to vo_destroy() is to make sure all queued asynchronous reuqests are finished before making the vo_thread exit. Even though it's only used on MS Windows, it's run on any platform with any VO, which makes this worse. --- player/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/misc.c') diff --git a/player/misc.c b/player/misc.c index bd65fb9d5b..c9e25a3966 100644 --- a/player/misc.c +++ b/player/misc.c @@ -149,8 +149,8 @@ void update_vo_playback_state(struct MPContext *mpctx) if ((oldstate.playing && oldstate.taskbar_progress) || (newstate.playing && newstate.taskbar_progress)) { - vo_control(mpctx->video_out, - VOCTRL_UPDATE_PLAYBACK_STATE, &newstate); + vo_control_async(mpctx->video_out, + VOCTRL_UPDATE_PLAYBACK_STATE, &newstate); } mpctx->vo_playback_state = newstate; } -- cgit v1.2.3