summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-13 18:33:06 +0200
committerwm4 <wm4@nowhere>2015-04-13 18:35:18 +0200
commit3823d5eb7efad4d35c5c8e49f95656ec781c5584 (patch)
treec442c2f4a6cc2e39a93c73720e921a6d9caed1fd
parent77c96f111c3b9471bdbf19769049dadf348a14a8 (diff)
downloadmpv-3823d5eb7efad4d35c5c8e49f95656ec781c5584.tar.bz2
mpv-3823d5eb7efad4d35c5c8e49f95656ec781c5584.tar.xz
vo_rpi: explicitly reference MMAL VC driver
This is optional, but ensures that linking with -Wl,--as-needed does not drop the MMAL VC driver. The driver normally "registers" itself in the library constructor, but since no symbols are explicitly referenced, the linker could remove it with as-needed enabled.
-rw-r--r--video/out/vo_rpi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index 48827b8a67..c60218d575 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -26,6 +26,7 @@
#include <interface/mmal/mmal.h>
#include <interface/mmal/util/mmal_util.h>
#include <interface/mmal/util/mmal_default_components.h>
+#include <interface/mmal/vc/mmal_vc_api.h>
#include <libavutil/rational.h>
@@ -488,6 +489,8 @@ static void uninit(struct vo *vo)
if (p->display)
vc_dispmanx_display_close(p->display);
+
+ mmal_vc_deinit();
}
static int preinit(struct vo *vo)
@@ -500,6 +503,11 @@ static int preinit(struct vo *vo)
bcm_host_init();
+ if (mmal_vc_init()) {
+ MP_FATAL(vo, "Could not initialize MMAL.\n");
+ return -1;
+ }
+
p->display = vc_dispmanx_display_open(p->display_nr);
p->update = vc_dispmanx_update_start(0);
if (!p->display || !p->update) {