meson: use require when checking for vdpau

Technically this was wrong. If you passed -Dvdpau=enabled but did not
have x11 (a requirement for this), the build would silently just not
build the vdpau VO. The correct behavior is for it to be a hard error.
Accomplish this by using the require function and making sure that x11
is indeed being used before attempting to find the library.
This commit is contained in:
Dudemanguy 2022-06-18 20:51:31 -05:00
parent 07d78f8c8b
commit 44ecf83a1b
1 changed files with 6 additions and 2 deletions

View File

@ -1494,8 +1494,12 @@ if vaapi_egl['use'] or vaapi_libplacebo['use']
sources += files('video/out/hwdec/hwdec_vaapi.c') sources += files('video/out/hwdec/hwdec_vaapi.c')
endif endif
vdpau = dependency('vdpau', version: '>= 0.2', required: get_option('vdpau')) vdpau_opt = get_option('vdpau').require(
if vdpau.found() and x11['use'] x11['use'],
error_message: 'x11 was not found!',
)
vdpau = dependency('vdpau', version: '>= 0.2', required: vdpau_opt)
if vdpau.found()
dependencies += vdpau dependencies += vdpau
features += 'vdpau' features += 'vdpau'
sources += files('video/filter/vf_vdpaupp.c', sources += files('video/filter/vf_vdpaupp.c',