diff options
author | Dudemanguy <random342@airmail.cc> | 2024-02-01 16:41:43 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-05 17:23:47 +0000 |
commit | 531868fe0d2a35fbbff78d9a9ff8f96df73e69fd (patch) | |
tree | 27917d2004335adcb17754829cc2870e2074f506 /video/out/vo.c | |
parent | 7616190aa4c41c738c53d11d4ef37e70551c39cc (diff) | |
download | mpv-531868fe0d2a35fbbff78d9a9ff8f96df73e69fd.tar.bz2 mpv-531868fe0d2a35fbbff78d9a9ff8f96df73e69fd.tar.xz |
player: ensure runtime updates of certain rendering options
When adding things like brightness or gamma, the video obviously needs a
redraw if paused. This happened to work in the normal case because the
OSD notification triggered a redraw, but if you use no-osd the picture
won't change. Fix this by adding another option flag, UPDATE_VIDEO, and
simply signalling we want a redraw. This gets handled along with the
normal osd redrawing check in the playloop so something like "no-osd add
gamma 1" actually works.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r-- | video/out/vo.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 1a385f8285..ce93c66810 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -1171,6 +1171,16 @@ void vo_redraw(struct vo *vo) mp_mutex_unlock(&in->lock); } +// Same as vo_redraw but the redraw is delayed until it +// is detected in the playloop. +void vo_set_want_redraw(struct vo *vo) +{ + struct vo_internal *in = vo->in; + mp_mutex_lock(&in->lock); + in->want_redraw = true; + mp_mutex_unlock(&in->lock); +} + bool vo_want_redraw(struct vo *vo) { struct vo_internal *in = vo->in; |