From 0c9ac5835be70ae26e4aa875e833fe2c7b3b3bf3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 10 Apr 2020 01:33:38 +0200 Subject: video: remove another redundant wakeup The wakeup at the end of VO frame rendering seems redundant, because after rendering almost no state changes. The player core can queue a new frame once frame rendering begins, and there's a separate wakeup for this. The only thing that actually changes is in->rendering. The only thing that seems to depend on it and can trigger a wakeup is the vo_still_displaying() function. Change it so that it needs an explicit call to a new API function, so we can avoid wakeups in the common case. The vo_still_displaying() code is mostly just moved around due to locking and for avoiding forward declarations. Also a somewhat risky change (tasty new bugs). --- player/video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/video.c b/player/video.c index bae32c3f4e..630cdeffe4 100644 --- a/player/video.c +++ b/player/video.c @@ -1108,8 +1108,10 @@ void write_video(struct MPContext *mpctx) struct mp_image_params p = mpctx->next_frames[0]->params; if (!vo->params || !mp_image_params_equal(&p, vo->params)) { // Changing config deletes the current frame; wait until it's finished. - if (vo_still_displaying(vo)) + if (vo_still_displaying(vo)) { + vo_request_wakeup_on_done(vo); return; + } const struct vo_driver *info = mpctx->video_out->driver; char extra[20] = {0}; -- cgit v1.2.3