[libdvdcss-devel] [PATCH] Fix CSS key caching on Android
hackndo <[email protected]> Tue, 27 Oct 2015 18:17:09 +0100
| Newsgroups | gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel |
|---|---|
| Message-ID | <[email protected]> |
From: Romain Bentz <[email protected]> --- 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" ); -- 2.4.9 (Apple Git-60) _______________________________________________ libdvdcss-devel mailing list [email protected] https://mailman.videolan.org/listinfo/libdvdcss-devel