summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-30 21:33:54 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-05-07 10:41:38 +0900
commita4ba496539d4354144645b327509a553cffc6443 (patch)
tree2a9afb0ddf3c7ec87b63e783422b3f4aab413d45
parent73fc12c4e256d9eb5ca204246d36500b045da8db (diff)
downloadmpv-a4ba496539d4354144645b327509a553cffc6443.tar.bz2
mpv-a4ba496539d4354144645b327509a553cffc6443.tar.xz
vo_rpi: update display size on display mode switches
(cherry picked from commit 8c7f3adb413ccea35aef3878f020d6a10e9ad5de)
-rw-r--r--video/out/vo_rpi.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index 684eddc560..6e0e92e7fb 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -30,6 +30,8 @@
#include <libavutil/rational.h>
+#include "osdep/atomics.h"
+
#include "common/common.h"
#include "common/msg.h"
#include "options/m_config.h"
@@ -73,6 +75,8 @@ struct priv {
// for RAM input
MMAL_POOL_T *swpool;
+ atomic_bool update_display;
+
int background_layer;
int video_layer;
int osd_layer;
@@ -525,15 +529,32 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_SCREENSHOT_WIN:
*(struct mp_image **)data = take_screenshot(vo);
return VO_TRUE;
+ case VOCTRL_CHECK_EVENTS:
+ if (atomic_load(&p->update_display)) {
+ atomic_store(&p->update_display, false);
+ update_display_size(vo);
+ }
+ return VO_TRUE;
}
return VO_NOTIMPL;
}
+static void tv_callback(void *callback_data, uint32_t reason, uint32_t param1,
+ uint32_t param2)
+{
+ struct vo *vo = callback_data;
+ struct priv *p = vo->priv;
+ atomic_store(&p->update_display, true);
+ vo_wakeup(vo);
+}
+
static void uninit(struct vo *vo)
{
struct priv *p = vo->priv;
+ vc_tv_unregister_callback_full(tv_callback, vo);
+
talloc_free(p->next_image);
wipe_osd(vo);
@@ -588,6 +609,8 @@ static int preinit(struct vo *vo)
if (update_display_size(vo) < 0)
goto fail;
+ vc_tv_register_callback(tv_callback, vo);
+
return 0;
fail: