[vlc-commits] commit: CrystalHD: look for the dll in common places (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Sun Jan 16 17:56:46 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Jan 16 17:56:03 2011 +0100| [58e76b5731642009db22e4559441a895b27c35aa] | committer: Jean-Baptiste Kempf 

CrystalHD: look for the dll in common places

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58e76b5731642009db22e4559441a895b27c35aa
---

 modules/codec/crystalhd.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/modules/codec/crystalhd.c b/modules/codec/crystalhd.c
index da25d3e..179a1f7 100644
--- a/modules/codec/crystalhd.c
+++ b/modules/codec/crystalhd.c
@@ -166,12 +166,25 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->p_sps_pps_buf  = NULL;
 
 #ifdef USE_DL_OPENING
-    p_sys->p_bcm_dll = LoadLibrary( "bcmDIL.dll" );
+#  define DLL_NAME "bcmDIL.dll"
+#  define PATHS_NB 3
+    static const char *psz_paths[PATHS_NB] = {
+    DLL_NAME,
+    "C:\\Program Files\\Broadcom\\Broadcom CrystalHD Decoder\\" DLL_NAME,
+    "C:\\Program Files (x86)\\Broadcom\\Broadcom CrystalHD Decoder\\" DLL_NAME,
+    };
+    for( int i = 0; i < PATHS_NB; i++ )
+    {
+        HINSTANCE p_bcm_dll = LoadLibrary( psz_paths[i] );
+        if( p_bcm_dll )
+        {
+            p_sys->p_bcm_dll = p_bcm_dll;
+            break;
+        }
+    }
     if( !p_sys->p_bcm_dll )
     {
-        #ifdef DEBUG_CRYSTALHD
         msg_Dbg( p_dec, "Couldn't load the CrystalHD dll");
-        #endif
         return VLC_EGENERIC;
     }
 



More information about the vlc-commits mailing list