0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
wm4 2015-04-13 18:33:06 +02:00
parent 77c96f111c
commit 3823d5eb7e

View File

@ -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) {