<div dir="ltr">Yes, sorry!<br><br>From c12efa17ddd2c89c25912dad1cac352481773283 Mon Sep 17 00:00:00 2001<br>From: ace20022 <<a href="mailto:ace20022@ymail.com">ace20022@ymail.com</a>><br>Date: Fri, 19 Sep 2014 13:21:09 +0200<br>Subject: [PATCH 1/2] Use DIR_SEP directive where reasonable.<br><br>---<br> src/examples/mpls_dump.c | 5 +++--<br> src/file/dir_win32.c | 2 +-<br> src/file/dirs_darwin.c | 6 +++---<br> src/file/dirs_xdg.c | 6 +++---<br> src/file/libaacs.c | 6 +++---<br> src/file/libbdplus.c | 6 +++---<br> src/libbluray/bdj/bdj.c | 11 ++++++-----<br> src/libbluray/bdj/common.h | 4 ++--<br> src/libbluray/bdj/native/org_videolan_Libbluray.c | 3 ++-<br> src/libbluray/bdnav/bdid_parse.c | 2 +-<br> src/libbluray/bdnav/clpi_parse.c | 2 +-<br> src/libbluray/bdnav/index_parse.c | 4 ++--<br> src/libbluray/bdnav/mpls_parse.c | 2 +-<br> src/libbluray/bluray.c | 4 ++--<br> src/libbluray/hdmv/mobj_parse.c | 4 ++--<br> 15 files changed, 35 insertions(+), 32 deletions(-)<br><br>diff --git a/src/examples/mpls_dump.c b/src/examples/mpls_dump.c<br>index a97ee33..7d94343 100644<br>--- a/src/examples/mpls_dump.c<br>+++ b/src/examples/mpls_dump.c<br>@@ -26,6 +26,7 @@<br> #include <libgen.h><br> <br> #include "util/strutl.h"<br>+#include "file/file.h"<br> <br> #include "libbluray/bdnav/mpls_parse.h"<br> #include "libbluray/bluray.h"<br>@@ -720,7 +721,7 @@ main(int argc, char *argv[])<br> if (S_ISDIR(st.st_mode)) {<br> <br> printf("Directory: %s:\n", argv[ii]);<br>- path = str_printf("%s/BDMV/PLAYLIST", argv[ii]);<br>+ path = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "PLAYLIST", argv[ii]);<br> if (path == NULL) {<br> fprintf(stderr, "Failed to find playlist path: %s\n", argv[ii]);<br> continue;<br>@@ -742,7 +743,7 @@ main(int argc, char *argv[])<br> qsort(dirlist, jj, sizeof(char*), _qsort_str_cmp);<br> for (jj = 0; dirlist[jj] != NULL; jj++) {<br> char *name = NULL;<br>- name = str_printf("%s/%s", path, dirlist[jj]);<br>+ name = str_printf("%s" DIR_SEP "%s", path, dirlist[jj]);<br> free(dirlist[jj]);<br> if (stat(name, &st)) {<br> free(name);<br>diff --git a/src/file/dir_win32.c b/src/file/dir_win32.c<br>index f2e8f1c..598b723 100644<br>--- a/src/file/dir_win32.c<br>+++ b/src/file/dir_win32.c<br>@@ -78,7 +78,7 @@ static BD_DIR_H *_dir_open_win32(const char* dirname)<br> dir->close = _dir_close_win32;<br> dir->read = _dir_read_win32;<br> <br>- char *filespec = str_printf("%s/*", dirname);<br>+ char *filespec = str_printf("%s" DIR_SEP "*", dirname);<br> dir_data_t *priv = calloc(1, sizeof(dir_data_t));<br> <br> dir->internal = priv;<br>diff --git a/src/file/dirs_darwin.c b/src/file/dirs_darwin.c<br>index b7fcc29..4895d9c 100644<br>--- a/src/file/dirs_darwin.c<br>+++ b/src/file/dirs_darwin.c<br>@@ -48,7 +48,7 @@ const char *file_get_config_home(void)<br> <br> const char *user_home = getenv("HOME");<br> if (user_home && *user_home) {<br>- return dir = str_printf("%s/%s", user_home, USER_CFG_DIR);<br>+ return dir = str_printf("%s" DIR_SEP "%s", user_home, USER_CFG_DIR);<br> }<br> <br> BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");<br>@@ -67,7 +67,7 @@ const char *file_get_data_home(void)<br> <br> const char *user_home = getenv("HOME");<br> if (user_home && *user_home) {<br>- return dir = str_printf("%s/%s", user_home, USER_DATA_DIR);<br>+ return dir = str_printf("%s" DIR_SEP "%s", user_home, USER_DATA_DIR);<br> }<br> <br> BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");<br>@@ -86,7 +86,7 @@ const char *file_get_cache_home(void)<br> <br> const char *user_home = getenv("HOME");<br> if (user_home && *user_home) {<br>- return dir = str_printf("%s/%s", user_home, USER_CACHE_DIR);<br>+ return dir = str_printf("%s" DIR_SEP "%s", user_home, USER_CACHE_DIR);<br> }<br> <br> BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");<br>diff --git a/src/file/dirs_xdg.c b/src/file/dirs_xdg.c<br>index df5d81b..3d08f33 100644<br>--- a/src/file/dirs_xdg.c<br>+++ b/src/file/dirs_xdg.c<br>@@ -56,7 +56,7 @@ const char *file_get_config_home(void)<br> <br> const char *user_home = getenv("HOME");<br> if (user_home && *user_home) {<br>- return dir = str_printf("%s/%s", user_home, USER_CFG_DIR);<br>+ return dir = str_printf("%s" DIR_SEP "%s", user_home, USER_CFG_DIR);<br> }<br> <br> BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");<br>@@ -80,7 +80,7 @@ const char *file_get_data_home(void)<br> <br> const char *user_home = getenv("HOME");<br> if (user_home && *user_home) {<br>- return dir = str_printf("%s/%s", user_home, USER_DATA_DIR);<br>+ return dir = str_printf("%s" DIR_SEP "%s", user_home, USER_DATA_DIR);<br> }<br> <br> BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");<br>@@ -104,7 +104,7 @@ const char *file_get_cache_home(void)<br> <br> const char *user_home = getenv("HOME");<br> if (user_home && *user_home) {<br>- return dir = str_printf("%s/%s", user_home, USER_CACHE_DIR);<br>+ return dir = str_printf("%s" DIR_SEP "%s", user_home, USER_CACHE_DIR);<br> }<br> <br> BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n");<br>diff --git a/src/file/libaacs.c b/src/file/libaacs.c<br>index d539d41..33d4cfa 100644<br>--- a/src/file/libaacs.c<br>+++ b/src/file/libaacs.c<br>@@ -72,18 +72,18 @@ int libaacs_required(const char *device_path)<br> BD_FILE_H *fd;<br> char *tmp;<br> <br>- tmp = str_printf("%s/AACS/Unit_Key_RO.inf", device_path);<br>+ tmp = str_printf("%s" DIR_SEP "AACS" DIR_SEP "Unit_Key_RO.inf", device_path);<br> fd = file_open(tmp, "rb");<br> X_FREE(tmp);<br> <br> if (fd) {<br> file_close(fd);<br> <br>- BD_DEBUG(DBG_BLURAY, "AACS/Unit_Key_RO.inf found. Disc seems to be AACS protected.\n");<br>+ BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf found. Disc seems to be AACS protected.\n");<br> return 1;<br> }<br> <br>- BD_DEBUG(DBG_BLURAY, "AACS/Unit_Key_RO.inf not found. No AACS protection.\n");<br>+ BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf not found. No AACS protection.\n");<br> return 0;<br> }<br> <br>diff --git a/src/file/libbdplus.c b/src/file/libbdplus.c<br>index f0f1ec5..977d4af 100644<br>--- a/src/file/libbdplus.c<br>+++ b/src/file/libbdplus.c<br>@@ -71,18 +71,18 @@ int libbdplus_required(const char *device_path)<br> BD_FILE_H *fd;<br> char *tmp;<br> <br>- tmp = str_printf("%s/BDSVM/00000.svm", device_path);<br>+ tmp = str_printf("%s" DIR_SEP "BDSVM" DIR_SEP "00000.svm", device_path);<br> fd = file_open(tmp, "rb");<br> X_FREE(tmp);<br> <br> if (fd) {<br> file_close(fd);<br> <br>- BD_DEBUG(DBG_BLURAY, "BDSVM/00000.svm found. Disc seems to be BD+ protected.\n");<br>+ BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm found. Disc seems to be BD+ protected.\n");<br> return 1;<br> }<br> <br>- BD_DEBUG(DBG_BLURAY, "BDSVM/00000.svm not found. No BD+ protection.\n");<br>+ BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm not found. No BD+ protection.\n");<br> return 0;<br> }<br> <br>diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c<br>index c54e7ee..7d0b97e 100644<br>--- a/src/libbluray/bdj/bdj.c<br>+++ b/src/libbluray/bdj/bdj.c<br>@@ -31,6 +31,7 @@<br> #include "libbluray/register.h"<br> #include "file/dirs.h"<br> #include "file/dl.h"<br>+#include "file/file.h"<br> #include "util/strutl.h"<br> #include "util/macro.h"<br> #include "util/logging.h"<br>@@ -125,7 +126,7 @@ static void *_load_jvm_win32(const char **p_java_home)<br> static void *_jvm_dlopen(const char *java_home, const char *jvm_dir, const char *jvm_lib)<br> {<br> if (java_home) {<br>- char *path = str_printf("%s/%s/%s", java_home, jvm_dir, jvm_lib);<br>+ char *path = str_printf("%s" DIR_SEP "%s" DIR_SEP "%s", java_home, jvm_dir, jvm_lib);<br> BD_DEBUG(DBG_BDJ, "Opening %s ...\n", path);<br> void *h = dl_dlopen(path, NULL);<br> X_FREE(path);<br>@@ -151,7 +152,7 @@ static void *_load_jvm(const char **p_java_home)<br> #else<br> # ifdef _WIN32<br> static const char *jvm_path[] = {NULL, JDK_HOME};<br>- static const char jvm_dir[] = "jre/bin/server";<br>+ static const char jvm_dir[] = "jre" DIR_SEP "bin" DIR_SEP "server";<br> static const char jvm_lib[] = "jvm";<br> # else<br> static const char *jvm_path[] = {NULL, JDK_HOME,<br>@@ -271,7 +272,7 @@ static const char *_bdj_persistent_root(void)<br> if (!root) {<br> root = "";<br> }<br>- root = str_printf("%s/bluray/dvb.persistent.root/", root);<br>+ root = str_printf("%s" DIR_SEP "bluray" DIR_SEP "dvb.persistent.root" DIR_SEP, root);<br> <br> BD_DEBUG(DBG_BDJ, "LIBBLURAY_PERSISTENT_ROOT not set, using %s\n", root);<br> <br>@@ -295,7 +296,7 @@ static const char *_bdj_buda_root(void)<br> if (!root) {<br> root = "";<br> }<br>- root = str_printf("%s/bluray/bluray.bindingunit.root/", root);<br>+ root = str_printf("%s" DIR_SEP "bluray" DIR_SEP "bluray.bindingunit.root" DIR_SEP, root);<br> <br> BD_DEBUG(DBG_BDJ, "LIBBLURAY_CACHE_ROOT not set, using %s\n", root);<br> <br>@@ -316,7 +317,7 @@ static int _bdj_init(BDJAVA *bdjava, JNIEnv *env)<br> return 0;<br> }<br> <br>- char* id_path = str_printf("%s/CERTIFICATE/id.bdmv", bdjava->path);<br>+ char* id_path = str_printf("%s" DIR_SEP "CERTIFICATE" DIR_SEP "id.bdmv", bdjava->path);<br> BDID_DATA *id = bdid_parse(id_path);<br> jlong param_bdjava_ptr = (jlong)(intptr_t) bdjava;<br> jstring param_disc_id = (*env)->NewStringUTF(env,<br>diff --git a/src/libbluray/bdj/common.h b/src/libbluray/bdj/common.h<br>index 745ea2c..8ad0ad6 100644<br>--- a/src/libbluray/bdj/common.h<br>+++ b/src/libbluray/bdj/common.h<br>@@ -28,8 +28,8 @@<br> #define BDJ_JARFILE "libbluray-j2se-" VERSION ".jar"<br> #endif<br> #define BDJ_CLASSPATH BDJ_JARFILE<br>-#define BDJ_BDJO_PATH "/BDMV/BDJO"<br>-#define BDJ_JAR_PATH "/BDMV/JAR"<br>+#define BDJ_BDJO_PATH DIR_SEP "BDMV" DIR_SEP "BDJO"<br>+#define BDJ_JAR_PATH DIR_SEP "BDMV" DIR_SEP "JAR"<br> <br> #define BDJ_ERROR 0<br> #define BDJ_SUCCESS 1<br>diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c<br>index 052f02e..2bae889 100644<br>--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c<br>+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c<br>@@ -29,6 +29,7 @@<br> #include "util/strutl.h"<br> #include "util/macro.h"<br> #include "util/logging.h"<br>+#include "file/file.h"<br> <br> #include <string.h><br> #include <inttypes.h><br>@@ -412,7 +413,7 @@ JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env,<br> <br> BDJAVA* bdj = (BDJAVA*)(intptr_t)np;<br> const char *bdjo_name = (*env)->GetStringUTFChars(env, name, NULL);;<br>- char* bdjo_path = str_printf("%s%s/%s.bdjo", bdj->path, BDJ_BDJO_PATH, bdjo_name);<br>+ char* bdjo_path = str_printf("%s%s" DIR_SEP "%s.bdjo", bdj->path, BDJ_BDJO_PATH, bdjo_name);<br> (*env)->ReleaseStringUTFChars(env, name, bdjo_name);<br> jobject bdjo = bdjo_read(env, bdjo_path);<br> X_FREE(bdjo_path);<br>diff --git a/src/libbluray/bdnav/bdid_parse.c b/src/libbluray/bdnav/bdid_parse.c<br>index e2a79b3..26874da 100644<br>--- a/src/libbluray/bdnav/bdid_parse.c<br>+++ b/src/libbluray/bdnav/bdid_parse.c<br>@@ -103,7 +103,7 @@ BDID_DATA *bdid_parse(const char *file_name)<br> char *backup = malloc(len + 8);<br> <br> strcpy(backup, file_name);<br>- strcpy(backup + len - 7, "BACKUP/id.bdmv");<br>+ strcpy(backup + len - 7, "BACKUP" DIR_SEP "id.bdmv");<br> <br> bdid = _bdid_parse(backup);<br> <br>diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c<br>index a6588b4..fe3ed49 100644<br>--- a/src/libbluray/bdnav/clpi_parse.c<br>+++ b/src/libbluray/bdnav/clpi_parse.c<br>@@ -743,7 +743,7 @@ clpi_parse(const char *path)<br> char *backup = malloc(len + 8);<br> <br> strncpy(backup, path, len - 18);<br>- strcpy(backup + len - 18, "BACKUP/");<br>+ strcpy(backup + len - 18, "BACKUP" DIR_SEP);<br> strcpy(backup + len - 18 + 7, path + len - 18);<br> <br> cl = _clpi_parse(backup);<br>diff --git a/src/libbluray/bdnav/index_parse.c b/src/libbluray/bdnav/index_parse.c<br>index d76a9c9..a8a6c49 100644<br>--- a/src/libbluray/bdnav/index_parse.c<br>+++ b/src/libbluray/bdnav/index_parse.c<br>@@ -231,7 +231,7 @@ INDX_ROOT *indx_parse(const char *disc_root)<br> INDX_ROOT *index;<br> char *file;<br> <br>- file = str_printf("%s/BDMV/index.bdmv", disc_root);<br>+ file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "index.bdmv", disc_root);<br> index = _indx_parse(file);<br> X_FREE(file);<br> if (index) {<br>@@ -239,7 +239,7 @@ INDX_ROOT *indx_parse(const char *disc_root)<br> }<br> <br> /* try backup */<br>- file = str_printf("%s/BDMV/BACKUP/index.bdmv", disc_root);<br>+ file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "BACKUP" DIR_SEP "index.bdmv", disc_root);<br> index = _indx_parse(file);<br> X_FREE(file);<br> return index;<br>diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c<br>index 715dcfa..82a029e 100644<br>--- a/src/libbluray/bdnav/mpls_parse.c<br>+++ b/src/libbluray/bdnav/mpls_parse.c<br>@@ -965,7 +965,7 @@ mpls_parse(const char *path)<br> char *backup = malloc(len + 8);<br> <br> strncpy(backup, path, len - 19);<br>- strcpy(backup + len - 19, "BACKUP/");<br>+ strcpy(backup + len - 19, "BACKUP" DIR_SEP);<br> strcpy(backup + len - 19 + 7, path + len - 19);<br> <br> pl = _mpls_parse(backup);<br>diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c<br>index 320f009..3a0c2c1 100644<br>--- a/src/libbluray/bluray.c<br>+++ b/src/libbluray/bluray.c<br>@@ -1996,7 +1996,7 @@ static int _preload_textst_subpath(BLURAY *bd)<br> /* set fonts and encoding from clip info */<br> gc_add_font(bd->graphics_controller, NULL);<br> for (ii = 0; ii < bd->st_textst.clip->cl->font_info.font_count; ii++) {<br>- char *file = str_printf("%s/BDMV/AUXDATA/%s.otf", bd->device_path, bd->st_textst.clip->cl->font_info.font[ii].file_id);<br>+ char *file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "AUXDATA" DIR_SEP "%s.otf", bd->device_path, bd->st_textst.clip->cl->font_info.font[ii].file_id);<br> gc_add_font(bd->graphics_controller, file);<br> X_FREE(file);<br> }<br>@@ -3368,7 +3368,7 @@ int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, BLURAY_SOUND_EFFECT *effe<br> <br> if (!bd->sound_effects) {<br> <br>- char *file = str_printf("%s/BDMV/AUXDATA/sound.bdmv", bd->device_path);<br>+ char *file = str_printf("%s"DIR_SEP "BDMV" DIR_SEP "AUXDATA" DIR_SEP "sound.bdmv", bd->device_path);<br> bd->sound_effects = sound_parse(file);<br> X_FREE(file);<br> <br>diff --git a/src/libbluray/hdmv/mobj_parse.c b/src/libbluray/hdmv/mobj_parse.c<br>index ae30398..3e26e72 100644<br>--- a/src/libbluray/hdmv/mobj_parse.c<br>+++ b/src/libbluray/hdmv/mobj_parse.c<br>@@ -193,7 +193,7 @@ MOBJ_OBJECTS *mobj_parse(const char *disc_root)<br> MOBJ_OBJECTS *objects;<br> char *file;<br> <br>- file = str_printf("%s/BDMV/MovieObject.bdmv", disc_root);<br>+ file = str_printf("%s"DIR_SEP "BDMV" DIR_SEP "MovieObject.bdmv", disc_root);<br> objects = _mobj_parse(file);<br> X_FREE(file);<br> if (objects) {<br>@@ -201,7 +201,7 @@ MOBJ_OBJECTS *mobj_parse(const char *disc_root)<br> }<br> <br> /* if failed, try backup file */<br>- file = str_printf("%s/BDMV/BACKUP/MovieObject.bdmv", disc_root);<br>+ file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "BACKUP" DIR_SEP "MovieObject.bdmv", disc_root);<br> objects = _mobj_parse(file);<br> X_FREE(file);<br> return objects;<br>-- <br>1.9.4.msysgit.1<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-23 9:42 GMT+02:00 Petri Hintukainen <span dir="ltr"><<a href="mailto:phintuka@users.sourceforge.net" target="_blank">phintuka@users.sourceforge.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On ma, 2014-09-22 at 10:22 +0200, Andreas Zelend wrote:<br>
> From 72b9bb8c2c20e7e2080e16c3129e73fb7acf9933 Mon Sep 17 00:00:00 2001<br>
> From: ace20022 <<a href="mailto:ace20022@ymail.com">ace20022@ymail.com</a>><br>
> Date: Fri, 19 Sep 2014 16:00:06 +0200<br>
> Subject: [PATCH 1/2] Add the possibility to set the persistent/cache root path<br>
> via bd_set_player_setting_str().<br>
<br>
Wrong patch attached ?<br>
<br>
_______________________________________________<br>
libbluray-devel mailing list<br>
<a href="mailto:libbluray-devel@videolan.org">libbluray-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libbluray-devel" target="_blank">https://mailman.videolan.org/listinfo/libbluray-devel</a><br>
</blockquote></div><br></div>