[libdvdcss-devel] Fix CSS key caching on Android
Romain Bentz
git at videolan.org
Tue Oct 27 18:30:00 CET 2015
libdvdcss | branch: master | Romain Bentz <bentz.romain at gmail.com> | Tue Oct 27 18:17:09 2015 +0100| [c064e7cab0b490a45f5760f21d8c80553f07ed36] | committer: Jean-Baptiste Kempf
Fix CSS key caching on Android
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=c064e7cab0b490a45f5760f21d8c80553f07ed36
---
src/libdvdcss.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 3f4f7e6..febdff2 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -216,6 +216,18 @@ static int set_cache_directory( dvdcss_t dvdcss )
psz_cache = dvdcss->psz_cachefile;
}
#else
+#ifdef __ANDROID__
+ /* $HOME is not writable on __ANDROID__ so we have to create a custom
+ * directory in userland */
+ char *psz_home = strdup("/sdcard/Android/data/org.videolan.dvdcss");
+
+ int i_ret = mkdir( psz_home, 0755 );
+ if( i_ret < 0 && errno != EEXIST )
+ {
+ print_error( dvdcss, "failed creating home directory" );
+ psz_home = NULL;
+ }
+#else
char *psz_home = NULL;
#ifdef HAVE_PWD_H
struct passwd *p_pwd;
@@ -228,6 +240,8 @@ static int set_cache_directory( dvdcss_t dvdcss )
}
#endif /* HAVE_PWD_H */
+#endif /* __ANDROID__ */
+
if( psz_home == NULL )
{
psz_home = getenv( "HOME" );
More information about the libdvdcss-devel
mailing list