[libbluray-devel] Use DIR_SEP directive where reasonable.

ace20022 git at videolan.org
Tue Sep 30 13:10:17 CEST 2014


libbluray | branch: master | ace20022 <ace20022 at ymail.com> | Fri Sep 19 13:21:09 2014 +0200| [6899f4000504f82af23049705f37e8cd101bbdce] | committer: hpi1

Use DIR_SEP directive where reasonable.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=6899f4000504f82af23049705f37e8cd101bbdce
---

 src/file/libaacs.c                |    6 +++---
 src/file/libbdplus.c              |    6 +++---
 src/libbluray/bdnav/bdid_parse.c  |    2 +-
 src/libbluray/bdnav/clpi_parse.c  |    2 +-
 src/libbluray/bdnav/index_parse.c |    4 ++--
 src/libbluray/bdnav/mpls_parse.c  |    2 +-
 src/libbluray/bluray.c            |    4 ++--
 src/libbluray/hdmv/mobj_parse.c   |    4 ++--
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/file/libaacs.c b/src/file/libaacs.c
index d539d41..33d4cfa 100644
--- a/src/file/libaacs.c
+++ b/src/file/libaacs.c
@@ -72,18 +72,18 @@ int libaacs_required(const char *device_path)
     BD_FILE_H *fd;
     char      *tmp;
 
-    tmp = str_printf("%s/AACS/Unit_Key_RO.inf", device_path);
+    tmp = str_printf("%s" DIR_SEP "AACS" DIR_SEP "Unit_Key_RO.inf", device_path);
     fd = file_open(tmp, "rb");
     X_FREE(tmp);
 
     if (fd) {
         file_close(fd);
 
-        BD_DEBUG(DBG_BLURAY, "AACS/Unit_Key_RO.inf found. Disc seems to be AACS protected.\n");
+        BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf found. Disc seems to be AACS protected.\n");
         return 1;
     }
 
-    BD_DEBUG(DBG_BLURAY, "AACS/Unit_Key_RO.inf not found. No AACS protection.\n");
+    BD_DEBUG(DBG_BLURAY, "AACS" DIR_SEP "Unit_Key_RO.inf not found. No AACS protection.\n");
     return 0;
 }
 
diff --git a/src/file/libbdplus.c b/src/file/libbdplus.c
index f0f1ec5..977d4af 100644
--- a/src/file/libbdplus.c
+++ b/src/file/libbdplus.c
@@ -71,18 +71,18 @@ int libbdplus_required(const char *device_path)
     BD_FILE_H *fd;
     char      *tmp;
 
-    tmp = str_printf("%s/BDSVM/00000.svm", device_path);
+    tmp = str_printf("%s" DIR_SEP "BDSVM" DIR_SEP "00000.svm", device_path);
     fd = file_open(tmp, "rb");
     X_FREE(tmp);
 
     if (fd) {
         file_close(fd);
 
-        BD_DEBUG(DBG_BLURAY, "BDSVM/00000.svm found. Disc seems to be BD+ protected.\n");
+        BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm found. Disc seems to be BD+ protected.\n");
         return 1;
     }
 
-    BD_DEBUG(DBG_BLURAY, "BDSVM/00000.svm not found. No BD+ protection.\n");
+    BD_DEBUG(DBG_BLURAY, "BDSVM" DIR_SEP "00000.svm not found. No BD+ protection.\n");
     return 0;
 }
 
diff --git a/src/libbluray/bdnav/bdid_parse.c b/src/libbluray/bdnav/bdid_parse.c
index e2a79b3..26874da 100644
--- a/src/libbluray/bdnav/bdid_parse.c
+++ b/src/libbluray/bdnav/bdid_parse.c
@@ -103,7 +103,7 @@ BDID_DATA *bdid_parse(const char *file_name)
         char *backup = malloc(len + 8);
 
         strcpy(backup, file_name);
-        strcpy(backup + len - 7, "BACKUP/id.bdmv");
+        strcpy(backup + len - 7, "BACKUP" DIR_SEP "id.bdmv");
 
         bdid = _bdid_parse(backup);
 
diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c
index a6588b4..fe3ed49 100644
--- a/src/libbluray/bdnav/clpi_parse.c
+++ b/src/libbluray/bdnav/clpi_parse.c
@@ -743,7 +743,7 @@ clpi_parse(const char *path)
         char *backup = malloc(len + 8);
 
         strncpy(backup, path, len - 18);
-        strcpy(backup + len - 18, "BACKUP/");
+        strcpy(backup + len - 18, "BACKUP" DIR_SEP);
         strcpy(backup + len - 18 + 7, path + len - 18);
 
         cl = _clpi_parse(backup);
diff --git a/src/libbluray/bdnav/index_parse.c b/src/libbluray/bdnav/index_parse.c
index d76a9c9..a8a6c49 100644
--- a/src/libbluray/bdnav/index_parse.c
+++ b/src/libbluray/bdnav/index_parse.c
@@ -231,7 +231,7 @@ INDX_ROOT *indx_parse(const char *disc_root)
     INDX_ROOT *index;
     char *file;
 
-    file = str_printf("%s/BDMV/index.bdmv", disc_root);
+    file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "index.bdmv", disc_root);
     index = _indx_parse(file);
     X_FREE(file);
     if (index) {
@@ -239,7 +239,7 @@ INDX_ROOT *indx_parse(const char *disc_root)
     }
 
     /* try backup */
-    file = str_printf("%s/BDMV/BACKUP/index.bdmv", disc_root);
+    file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "BACKUP" DIR_SEP "index.bdmv", disc_root);
     index = _indx_parse(file);
     X_FREE(file);
     return index;
diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c
index 715dcfa..82a029e 100644
--- a/src/libbluray/bdnav/mpls_parse.c
+++ b/src/libbluray/bdnav/mpls_parse.c
@@ -965,7 +965,7 @@ mpls_parse(const char *path)
         char *backup = malloc(len + 8);
 
         strncpy(backup, path, len - 19);
-        strcpy(backup + len - 19, "BACKUP/");
+        strcpy(backup + len - 19, "BACKUP" DIR_SEP);
         strcpy(backup + len - 19 + 7, path + len - 19);
 
         pl = _mpls_parse(backup);
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index c750b18..49b4304 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2011,7 +2011,7 @@ static int _preload_textst_subpath(BLURAY *bd)
     /* set fonts and encoding from clip info */
     gc_add_font(bd->graphics_controller, NULL);
     for (ii = 0; ii < bd->st_textst.clip->cl->font_info.font_count; ii++) {
-        char *file = str_printf("%s/BDMV/AUXDATA/%s.otf", bd->device_path, bd->st_textst.clip->cl->font_info.font[ii].file_id);
+        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);
         gc_add_font(bd->graphics_controller, file);
         X_FREE(file);
     }
@@ -3411,7 +3411,7 @@ int bd_get_sound_effect(BLURAY *bd, unsigned sound_id, BLURAY_SOUND_EFFECT *effe
 
     if (!bd->sound_effects) {
 
-        char *file = str_printf("%s/BDMV/AUXDATA/sound.bdmv", bd->device_path);
+        char *file = str_printf("%s"DIR_SEP "BDMV" DIR_SEP "AUXDATA" DIR_SEP "sound.bdmv", bd->device_path);
         bd->sound_effects = sound_parse(file);
         X_FREE(file);
 
diff --git a/src/libbluray/hdmv/mobj_parse.c b/src/libbluray/hdmv/mobj_parse.c
index ae30398..3e26e72 100644
--- a/src/libbluray/hdmv/mobj_parse.c
+++ b/src/libbluray/hdmv/mobj_parse.c
@@ -193,7 +193,7 @@ MOBJ_OBJECTS *mobj_parse(const char *disc_root)
     MOBJ_OBJECTS *objects;
     char *file;
 
-    file = str_printf("%s/BDMV/MovieObject.bdmv", disc_root);
+    file = str_printf("%s"DIR_SEP "BDMV" DIR_SEP "MovieObject.bdmv", disc_root);
     objects = _mobj_parse(file);
     X_FREE(file);
     if (objects) {
@@ -201,7 +201,7 @@ MOBJ_OBJECTS *mobj_parse(const char *disc_root)
     }
 
     /* if failed, try backup file */
-    file = str_printf("%s/BDMV/BACKUP/MovieObject.bdmv", disc_root);
+    file = str_printf("%s" DIR_SEP "BDMV" DIR_SEP "BACKUP" DIR_SEP "MovieObject.bdmv", disc_root);
     objects = _mobj_parse(file);
     X_FREE(file);
     return objects;



More information about the libbluray-devel mailing list