aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-04-30 21:33:54 +0200
committerGravatar wm4 <wm4@nowhere>2015-04-30 21:56:16 +0200
commit8c7f3adb413ccea35aef3878f020d6a10e9ad5de (patch)
tree12f0c0b5c8bb5babfae674e65470e784b108d6e5
parent6ae66e717faa4e9ce286ff0532d4ec19a66faf49 (diff)
vo_rpi: update display size on display mode switches
-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: