Path: blob/next/external/packages/extras-buildpkgs/libvdpau/debian/patches/vdpau-module-searchpath.patch
13273 views
From: Andreas Beckmann <[email protected]>1Subject: search the vdpau module in multiple directories2start searching the vdpau module in ${ORIGIN}/vdpau, then the MODULEDIR and3finally fall back to /usr/lib/vdpau45--- a/src/vdpau_wrapper.c6+++ b/src/vdpau_wrapper.c7@@ -103,6 +103,13 @@ static char * _vdp_get_driver_name_from_8return driver_name;9}1011+static char const * _vdpau_module_search_paths[] = {12+ "${ORIGIN}/vdpau",13+ VDPAU_MODULEDIR,14+ "/usr/lib/vdpau",15+ NULL16+};17+18static VdpStatus _vdp_open_driver(19Display * display,20int screen)21@@ -117,6 +127,7 @@ static VdpStatus _vdp_open_driver(22char vdpau_driver_lib[PATH_MAX];23char const * vdpau_trace;24char const * func_name;25+ char const ** module_path;2627vdpau_driver = secure_getenv("VDPAU_DRIVER");28if (vdpau_driver) {29@@ -138,9 +146,11 @@ static VdpStatus _vdp_open_driver(3031/* Fallback to VDPAU_MODULEDIR when VDPAU_DRIVER_PATH is not set,32* or if we fail to create the driver path/dlopen the library. */33- if (!_vdp_driver_dll) {34+ for (module_path = _vdpau_module_search_paths;35+ !_vdp_driver_dll && *module_path;36+ ++module_path) {37if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib),38- DRIVER_LIB_FORMAT, VDPAU_MODULEDIR, vdpau_driver) >=39+ DRIVER_LIB_FORMAT, *module_path, vdpau_driver) >=40sizeof(vdpau_driver_lib)) {41fprintf(stderr, "Failed to construct driver path: path too long\n");42}434445