summaryrefslogtreecommitdiff
path: root/devel/opal/patches/patch-ac
blob: 5151debcac05041d36bbc46dc63aa1e0be476bb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$NetBSD: patch-ac,v 1.1 2008/09/29 01:28:50 jmcneill Exp $

--- plugins/video/common/dyna.cxx.orig	2008-09-28 20:48:56.000000000 -0400
+++ plugins/video/common/dyna.cxx
@@ -89,6 +89,7 @@ bool DynaLink::InternalOpen(const char *
 #else
   WITH_ALIGNED_STACK({  // must be called before using avcodec lib
     _hDLL = dlopen((const char *)path, RTLD_NOW);
+    _hDLLutil = dlopen("libavutil.so", RTLD_NOW);
   });
 #endif /* _WIN32 */
 
@@ -119,8 +120,10 @@ void DynaLink::Close()
     FreeLibrary(_hDLL);
 #else
     dlclose(_hDLL);
+    if (_hDLLutil)
+      dlclose(_hDLLutil);
 #endif /* _WIN32 */
-    _hDLL = NULL;
+    _hDLL = _hDLLutil = NULL;
   }
 }
 
@@ -143,6 +146,8 @@ bool DynaLink::GetFunction(const char * 
   return true;
 #else
   void * p = dlsym(_hDLL, (const char *)name);
+  if (p == NULL && _hDLLutil != NULL)
+    p = dlsym(_hDLLutil, (const char *)name);
   if (p == NULL) {
     TRACE(1, _codecString << "\tDYNA\tError " << dlerror());
     return false;