[libbluray-devel] Join .bdjo path at java side

hpi1 git at videolan.org
Tue Oct 28 10:07:20 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Oct 28 11:02:32 2014 +0200| [15c9f27897dfa2da8c530e0dbe4d0e2f90cf8d67] | committer: hpi1

Join .bdjo path at java side

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

 src/libbluray/bdj/java/org/videolan/Libbluray.java |    7 ++++++-
 src/libbluray/bdj/native/org_videolan_Libbluray.c  |   14 ++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index 0d884d9..2f1488a 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -22,6 +22,7 @@ package org.videolan;
 
 import java.awt.BDToolkit;
 import java.awt.event.KeyEvent;
+import java.io.File;
 import java.util.Vector;
 
 import javax.media.PackageManager;
@@ -325,7 +326,11 @@ public class Libbluray {
     }
 
     public static Bdjo getBdjo(String name) {
-        return getBdjoN(nativePointer, name);
+        return getBdjoN(nativePointer,
+                        System.getProperty("bluray.vfs.root") + File.separator +
+                        "BDMV" + File.separator +
+                        "BDJO" + File.separator +
+                        name + ".bdjo");
     }
 
     public static void updateGraphic(int width, int height, int[] rgbArray) {
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 0a946d1..4154b16 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -432,14 +432,12 @@ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_readPSRN(JNIEnv * env,
 }
 
 JNIEXPORT jobject JNICALL Java_org_videolan_Libbluray_getBdjoN(JNIEnv * env,
-                                                               jclass cls, jlong np, jstring name) {
-
-  BDJAVA* bdj = (BDJAVA*)(intptr_t)np;
-  const char *bdjo_name = (*env)->GetStringUTFChars(env, name, NULL);;
-  char* bdjo_path = str_printf("%s/BDMV/BDJO/%s.bdjo", bdj->path, bdjo_name);
-  (*env)->ReleaseStringUTFChars(env, name, bdjo_name);
-  jobject bdjo = bdjo_read(env, bdjo_path);
-  X_FREE(bdjo_path);
+                                                               jclass cls, jlong np, jstring jpath) {
+
+  (void)np;
+  const char *path = (*env)->GetStringUTFChars(env, jpath, NULL);
+  jobject bdjo = bdjo_read(env, path);
+  (*env)->ReleaseStringUTFChars(env, jpath, path);
 
   return bdjo;
 }



More information about the libbluray-devel mailing list