Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

[droid] add android path checks. Credit Memphiz #64

Merged
merged 1 commit into from Oct 15, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion xbmc/libXBMC_addon.h
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down
12 changes: 11 additions & 1 deletion xbmc/libXBMC_gui.h
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down
12 changes: 11 additions & 1 deletion xbmc/libXBMC_pvr.h
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down