depot/third_party/nixpkgs/pkgs/development/libraries/gstreamer/bad/fix-paths.patch
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

48 lines
1.7 KiB
Diff

diff --git a/sys/nvcodec/gstcudaloader.c b/sys/nvcodec/gstcudaloader.c
index 4223ba1fbd..ca8bb5ceb1 100644
--- a/sys/nvcodec/gstcudaloader.c
+++ b/sys/nvcodec/gstcudaloader.c
@@ -135,6 +135,11 @@ gst_cuda_load_library (void)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open("@driverLink@/lib/" CUDA_LIBNAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
diff --git a/sys/nvcodec/gstcuvidloader.c b/sys/nvcodec/gstcuvidloader.c
index 3c7505ca36..eeb376fa80 100644
--- a/sys/nvcodec/gstcuvidloader.c
+++ b/sys/nvcodec/gstcuvidloader.c
@@ -85,6 +85,11 @@ gst_cuvid_load_library (guint api_major_ver, guint api_minor_ver)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open ("@driverLink@/lib/" NVCUVID_LIBNAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
diff --git a/sys/nvcodec/gstnvenc.c b/sys/nvcodec/gstnvenc.c
index 19637671ad..39858ccdee 100644
--- a/sys/nvcodec/gstnvenc.c
+++ b/sys/nvcodec/gstnvenc.c
@@ -874,6 +874,11 @@ gst_nvenc_load_library (guint * api_major_ver, guint * api_minor_ver)
};
module = g_module_open (NVENC_LIBRARY_NAME, G_MODULE_BIND_LAZY);
+
+ if (module == NULL) {
+ module = g_module_open ("@driverLink@/lib/" NVENC_LIBRARY_NAME, G_MODULE_BIND_LAZY);
+ }
+
if (module == NULL) {
GST_WARNING ("Could not open library %s, %s",
NVENC_LIBRARY_NAME, g_module_error ());