Commit 50a92094 authored by Romain Bentz's avatar Romain Bentz Committed by Jean-Baptiste Kempf

Fix CSS key caching on Android

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3a322908
......@@ -215,6 +215,18 @@ static int set_cache_directory( dvdcss_t dvdcss )
dvdcss->psz_cachefile[PATH_MAX - 1] = '\0';
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 = "/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
......@@ -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" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment