summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-19 13:11:30 -0500
committerDudemanguy <random342@airmail.cc>2023-09-19 13:11:30 -0500
commit27a78276eb4b68f230e441e1baedf26f3cd66fbd (patch)
treebe25a3c67774ddafca1a97c3fa3846cb68742a89 /video
parent7a76cf4d65fc56fbf0a0f600ec770324c44b81e7 (diff)
downloadmpv-27a78276eb4b68f230e441e1baedf26f3cd66fbd.tar.bz2
mpv-27a78276eb4b68f230e441e1baedf26f3cd66fbd.tar.xz
vo: avoid unnecessary redraws when the OSD shows
296d40dc6f38401085d005bb4627f8afff46b041 changed how the vo handled redraw requests in order to fix a race condition that can occur with pausing. However, there was a slight oversight because a redraw request that occurred while the core was unlocked and the video was still playing would still be kept true (previously, this was always cleared). That redraw is essential if mpv is paused otherwise the old issue comes back, but if the video is playing it's unnecessary since the next loop around will simply draw whatever we needed. The extra redraw could cause a frame drop for some people in certain instances, so the solution is to simply always clear redraw requests if !in->paused. This eliminates the extra redraw but still keeps it when pausing. Fixes #12426 and fixes #11579.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index faa172f2fd..7f57df2fe1 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -1010,13 +1010,13 @@ static bool render_frame(struct vo *vo)
if (in->dropped_frame) {
MP_STATS(vo, "drop-vo");
} else {
- // If the initial redraw request was true, then we can
- // clear it here since we just performed a redraw and are
- // merely clearing that request. However if there initially is
+ // If the initial redraw request was true or mpv is still playing,
+ // then we can clear it here since we just performed a redraw, or the
+ // next loop will draw what we need. However if there initially is
// no redraw request, then something can change this (i.e. the OSD)
- // while the vo was unlocked. Don't touch in->request_redraw
- // in that case.
- if (request_redraw)
+ // while the vo was unlocked. If we are paused, don't touch
+ // in->request_redraw in that case.
+ if (request_redraw || !in->paused)
in->request_redraw = false;
}