Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong
GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/packages/extras-buildpkgs/libvdpau/debian/patches/vdpau-module-searchpath.patch
13273 views
1
From: Andreas Beckmann <[email protected]>
2
Subject: search the vdpau module in multiple directories
3
start searching the vdpau module in ${ORIGIN}/vdpau, then the MODULEDIR and
4
finally fall back to /usr/lib/vdpau
5
6
--- a/src/vdpau_wrapper.c
7
+++ b/src/vdpau_wrapper.c
8
@@ -103,6 +103,13 @@ static char * _vdp_get_driver_name_from_
9
return driver_name;
10
}
11
12
+static char const * _vdpau_module_search_paths[] = {
13
+ "${ORIGIN}/vdpau",
14
+ VDPAU_MODULEDIR,
15
+ "/usr/lib/vdpau",
16
+ NULL
17
+};
18
+
19
static VdpStatus _vdp_open_driver(
20
Display * display,
21
int screen)
22
@@ -117,6 +127,7 @@ static VdpStatus _vdp_open_driver(
23
char vdpau_driver_lib[PATH_MAX];
24
char const * vdpau_trace;
25
char const * func_name;
26
+ char const ** module_path;
27
28
vdpau_driver = secure_getenv("VDPAU_DRIVER");
29
if (vdpau_driver) {
30
@@ -138,9 +146,11 @@ static VdpStatus _vdp_open_driver(
31
32
/* Fallback to VDPAU_MODULEDIR when VDPAU_DRIVER_PATH is not set,
33
* or if we fail to create the driver path/dlopen the library. */
34
- if (!_vdp_driver_dll) {
35
+ for (module_path = _vdpau_module_search_paths;
36
+ !_vdp_driver_dll && *module_path;
37
+ ++module_path) {
38
if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib),
39
- DRIVER_LIB_FORMAT, VDPAU_MODULEDIR, vdpau_driver) >=
40
+ DRIVER_LIB_FORMAT, *module_path, vdpau_driver) >=
41
sizeof(vdpau_driver_lib)) {
42
fprintf(stderr, "Failed to construct driver path: path too long\n");
43
}
44
45