[libbluray-devel] Accept directory in LIBBLURAY_CP

hpi1 git at videolan.org
Sun Feb 22 22:08:22 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Feb 22 17:16:40 2015 +0200| [26b48905e0df5383341f616fc6c2a1eae2cc5f0c] | committer: hpi1

Accept directory in LIBBLURAY_CP

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

 ChangeLog               |    1 +
 src/libbluray/bdj/bdj.c |   15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d345c4e..7848838 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 - Add UDF volume identifier to DISC_INFO.
 - Fix infinite loop with some broken HDMV menus.
 - Emit BD_EVENT_PLAYLIST_STOP when playlist playback is stopped in middle.
+- Accept directory name (without .jar file name) in LIBBLURAY_CP.
 
 2015-01-26: Version 0.7.0
 - Add player setting for BD-J persistent storage and cache paths.
diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index ebdeb53..6249812 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -220,11 +220,20 @@ static const char *_find_libbluray_jar(void)
     FILE *fp;
     unsigned i;
 
-    // check if overriding the classpath
-    if (!classpath) {
-        classpath = getenv("LIBBLURAY_CP");
+    if (classpath) {
+        return classpath;
     }
+
+    // check if overriding the classpath
+    classpath = getenv("LIBBLURAY_CP");
     if (classpath) {
+        size_t cp_len = strlen(classpath);
+
+        // directory or file ?
+        if (cp_len > 0 && (classpath[cp_len - 1] == '/' || classpath[cp_len - 1] == '\\')) {
+            classpath = str_printf("%s%s", classpath, BDJ_JARFILE);
+        }
+
         return classpath;
     }
 



More information about the libbluray-devel mailing list