cec: added vendor id Loewe
[deb_libcec.git] / include / cecloader.h
index 1b0be87cad7e9995538c83f1c984bfca2e97f6f1..7a7dce6cf583d70c340e7f1fc9f5d0bcd5c9a595 100644 (file)
@@ -134,7 +134,8 @@ bool LibCecBootloader(const char *strLib = NULL)
     return false;
 
   bool bReturn = LibCecBootloader();
-  UnloadLibCec(static_cast< CEC::ICECAdapter* > g_libCEC);
+  FreeLibrary(g_libCEC);
+  g_libCEC = NULL;
   return bReturn;
 }
 
@@ -158,15 +159,11 @@ CEC::ICECAdapter *LibCecInit(const char *strDeviceName, CEC::cec_device_type_lis
 #if defined(__APPLE__)
     g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY);
 #else
-    g_libCEC = dlopen(strLib ? strLib : "libcec.so", RTLD_LAZY);
+    g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY);
 #endif
     if (!g_libCEC)
     {
-#if defined(__APPLE__)
-      cout << "cannot find " << (strLib ? strLib : "libcec.dylib") << dlerror() << endl;
-#else
-      cout << "cannot find " << (strLib ? strLib : "libcec.so") << dlerror() << endl;
-#endif
+      cout << dlerror() << endl;
       return NULL;
     }
   }
@@ -195,15 +192,11 @@ CEC::ICECAdapter *LibCecInitialise(CEC::libcec_configuration *configuration, con
 #if defined(__APPLE__)
     g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY);
 #else
-    g_libCEC = dlopen(strLib ? strLib : "libcec.so", RTLD_LAZY);
+    g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY);
 #endif
     if (!g_libCEC)
     {
-#if defined(__APPLE__)
-      cout << "cannot find " << (strLib ? strLib : "libcec.dylib") << dlerror() << endl;
-#else
-      cout << "cannot find " << (strLib ? strLib : "libcec.so") << dlerror() << endl;
-#endif
+      cout << dlerror() << endl;
       return NULL;
     }
   }
@@ -245,15 +238,11 @@ bool LibCecBootloader(const char *strLib = NULL)
 #if defined(__APPLE__)
     g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY);
 #else
-    g_libCEC = dlopen(strLib ? strLib : "libcec.so", RTLD_LAZY);
+    g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY);
 #endif
     if (!g_libCEC)
     {
-#if defined(__APPLE__)
-      cout << "cannot find " << (strLib ? strLib : "libcec.dylib") << dlerror() << endl;
-#else
-      cout << "cannot find " << (strLib ? strLib : "libcec.so") << dlerror() << endl;
-#endif
+      cout << dlerror() << endl;
       return NULL;
     }
   }
@@ -267,7 +256,7 @@ bool LibCecBootloader(const char *strLib = NULL)
   }
 
   bool bReturn = LibCecBootloader();
-  UnloadLibCec((CEC::ICECAdapter*)g_libCEC);
+  dlclose(g_libCEC);
   return bReturn;
 }