From f9279651171338a8e147a4468e175c1b30861b32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 20 Dec 2015 22:13:24 +0100
Subject: nvencodeapi: Add debian specific paths to native library.

---
 dlls/nvencodeapi/nvencodeapi.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/nvencodeapi/nvencodeapi.c b/dlls/nvencodeapi/nvencodeapi.c
index 7a0f531..557c6ae 100644
--- a/dlls/nvencodeapi/nvencodeapi.c
+++ b/dlls/nvencodeapi/nvencodeapi.c
@@ -324,7 +324,23 @@ NVENCSTATUS WINAPI NvEncodeAPICreateInstance(NV_ENCODE_API_FUNCTION_LIST *functi
 
 static BOOL load_nvencode(void)
 {
-    libnvidia_encode_handle = dlopen("libnvidia-encode.so", RTLD_NOW);
+    static const char *libname[] =
+    {
+        "libnvidia-encode.so",
+        #ifdef __i386__
+        "/usr/lib/i386-linux-gnu/nvidia/current/libnvidia-encode.so",
+        #elif defined __x86_64__
+        "/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-encode.so",
+        #endif
+    };
+    int i;
+
+    for (i = 0; i < sizeof(libname)/sizeof(libname[0]); i++)
+    {
+        libnvidia_encode_handle = dlopen(libname[i], RTLD_NOW);
+        if (libnvidia_encode_handle) break;
+    }
+
     if (!libnvidia_encode_handle)
     {
         FIXME("Wine cannot find the libnvidia-encode.so library, NVIDIA video encoding support disabled.\n");
-- 
2.6.4

