summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHo Ming Shun <cyph1984@gmail.com>2021-08-11 15:01:10 +0800
committerDudemanguy <random342@airmail.cc>2021-08-13 17:14:31 +0000
commit312e29cf7fff0f3d8d5a592b2fc2904063d7ded5 (patch)
tree5c68be381aea3a8737b6a13e744202c20685f8a0
parentf4ceea9b8ae9934c47b9a463730cb09380afb094 (diff)
downloadmpv-312e29cf7fff0f3d8d5a592b2fc2904063d7ded5.tar.bz2
mpv-312e29cf7fff0f3d8d5a592b2fc2904063d7ded5.tar.xz
vo_rpi: restore fullscreen handling
Previous fullscreen handling code was removed in 59cdfe50b2 during deprecation of VOCTRL_FULLSCREEN. Lack of this code caused the OSD layer to be to be not resized along with the video layer when fullscreen is toggled.
-rw-r--r--video/out/vo_rpi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index bc5babb33f..47100285ec 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -69,6 +69,7 @@ struct priv {
double osd_pts;
struct mp_osd_res osd_res;
+ struct m_config_cache *opts_cache;
struct mp_egl_rpi egl;
struct gl_video *gl_video;
@@ -720,11 +721,28 @@ fail:
return NULL;
}
+static void set_fullscreen(struct vo *vo) {
+ struct priv *p = vo->priv;
+
+ if (p->renderer_enabled)
+ set_geometry(vo);
+ vo->want_redraw = true;
+}
+
static int control(struct vo *vo, uint32_t request, void *data)
{
struct priv *p = vo->priv;
switch (request) {
+ case VOCTRL_VO_OPTS_CHANGED: {
+ void *opt;
+ while (m_config_cache_get_next_changed(p->opts_cache, &opt)) {
+ struct mp_vo_opts *opts = p->opts_cache->opts;
+ if (&opts->fullscreen == opt)
+ set_fullscreen(vo);
+ }
+ return VO_TRUE;
+ }
case VOCTRL_SET_PANSCAN:
if (p->renderer_enabled)
resize(vo);
@@ -870,6 +888,8 @@ static int preinit(struct vo *vo)
pthread_mutex_init(&p->display_mutex, NULL);
pthread_cond_init(&p->display_cond, NULL);
+ p->opts_cache = m_config_cache_alloc(p, vo->global, &vo_sub_opts);
+
if (recreate_dispmanx(vo) < 0)
goto fail;