Skip to content
Browse files

[droid/pvr] add android path checks. credit @memphiz

  • Loading branch information...
1 parent f95b6b7 commit 7c0635351bba9794a01bc5bfd281db597617f644 @opdenkamp opdenkamp committed
View
15 addons/library.xbmc.addon/libXBMC_addon.h
@@ -59,7 +59,11 @@
#endif
#include <dlfcn.h> // linux+osx
#define ADDON_HELPER_EXT ".so"
-#define ADDON_DLL "/library.xbmc.addon/libXBMC_addon-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
+#define ADDON_DLL_NAME "libXBMC_addon-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
+#define ADDON_DLL "/library.xbmc.addon/" ADDON_DLL_NAME
+#endif
+#if defined(ANDROID)
+#include <sys/stat.h>
#endif
#ifdef LOG_DEBUG
@@ -118,6 +122,15 @@ namespace ADDON
libBasePath = ((cb_array*)m_Handle)->libPath;
libBasePath += ADDON_DLL;
+#if defined(ANDROID)
+ struct stat st;
+ if(stat(libBasePath.c_str(),&st) != 0)
+ {
+ std::string tempbin = getenv("XBMC_ANDROID_LIBS");
+ libBasePath = tempbin + "/" + ADDON_DLL_NAME;
+ }
+#endif
+
m_libXBMC_addon = dlopen(libBasePath.c_str(), RTLD_LAZY);
if (m_libXBMC_addon == NULL)
{
View
12 addons/library.xbmc.gui/libXBMC_gui.h
@@ -31,7 +31,8 @@ typedef void* GUIHANDLE;
#ifdef _WIN32
#define GUI_HELPER_DLL "\\library.xbmc.gui\\libXBMC_gui" ADDON_HELPER_EXT
#else
-#define GUI_HELPER_DLL "/library.xbmc.gui/libXBMC_gui-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
+#define GUI_HELPER_DLL_NAME "libXBMC_gui-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
+#define GUI_HELPER_DLL "/library.xbmc.gui/" GUI_HELPER_DLL_NAME
#endif
#define ADDON_ACTION_PREVIOUS_MENU 10
@@ -69,6 +70,15 @@ class CHelper_libXBMC_gui
libBasePath = ((cb_array*)m_Handle)->libPath;
libBasePath += GUI_HELPER_DLL;
+#if defined(ANDROID)
+ struct stat st;
+ if(stat(libBasePath.c_str(),&st) != 0)
+ {
+ std::string tempbin = getenv("XBMC_ANDROID_LIBS");
+ libBasePath = tempbin + "/" + GUI_HELPER_DLL_NAME;
+ }
+#endif
+
m_libXBMC_gui = dlopen(libBasePath.c_str(), RTLD_LAZY);
if (m_libXBMC_gui == NULL)
{
View
12 addons/library.xbmc.pvr/libXBMC_pvr.h
@@ -30,7 +30,8 @@
#ifdef _WIN32
#define PVR_HELPER_DLL "\\library.xbmc.pvr\\libXBMC_pvr" ADDON_HELPER_EXT
#else
-#define PVR_HELPER_DLL "/library.xbmc.pvr/libXBMC_pvr-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
+#define PVR_HELPER_DLL_NAME "libXBMC_pvr-" ADDON_HELPER_ARCH ADDON_HELPER_EXT
+#define PVR_HELPER_DLL "/library.xbmc.pvr/" PVR_HELPER_DLL_NAME
#endif
#define DVD_TIME_BASE 1000000
@@ -67,6 +68,15 @@ class CHelper_libXBMC_pvr
libBasePath = ((cb_array*)m_Handle)->libPath;
libBasePath += PVR_HELPER_DLL;
+#if defined(ANDROID)
+ struct stat st;
+ if(stat(libBasePath.c_str(),&st) != 0)
+ {
+ std::string tempbin = getenv("XBMC_ANDROID_LIBS");
+ libBasePath = tempbin + "/" + PVR_HELPER_DLL_NAME;
+ }
+#endif
+
m_libXBMC_pvr = dlopen(libBasePath.c_str(), RTLD_LAZY);
if (m_libXBMC_pvr == NULL)
{

0 comments on commit 7c06353

Please sign in to comment.
Something went wrong with that request. Please try again.