Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@theuni
Collaborator

TVHeadend verified working. Still at least one build-related bug with VDR.

Done as a PR as I'm not familiar with the header syncing process.

@theuni
Collaborator

@opdenkamp ping. Any issue with this? We may be able to handle it more nicely by wrapping, but for now this works. I'd like to get it in there so that we can push the changes on the XBMC side and let users begin testing pvr+android asap.

@opdenkamp opdenkamp merged commit 46eb5b5 into opdenkamp:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 13, 2012
  1. [droid] add android path checks. Credit Memphiz

    Cory Fields authored
This page is out of date. Refresh to see the latest.
Showing with 36 additions and 3 deletions.
  1. +14 −1 xbmc/libXBMC_addon.h
  2. +11 −1 xbmc/libXBMC_gui.h
  3. +11 −1 xbmc/libXBMC_pvr.h
View
15 xbmc/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 xbmc/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 xbmc/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)
{
Something went wrong with that request. Please try again.