[libbluray-devel] Fix Libbluray.selectAngle()

hpi1 git at videolan.org
Mon Nov 17 12:59:04 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Nov 17 13:13:33 2014 +0200| [256684db78b1129d56b5f578a926472f869a37d2] | committer: hpi1

Fix Libbluray.selectAngle()

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

 src/libbluray/bdj/java/org/videolan/Libbluray.java |    2 +-
 src/libbluray/bdj/native/org_videolan_Libbluray.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index 161a6a0..9134622 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -251,7 +251,7 @@ public class Libbluray {
     }
 
     public static boolean selectAngle(int angle) {
-        if (angle < 0)
+        if (angle < 1)
             throw new IllegalArgumentException("Angle cannot be negative");
 
         return selectAngleN(nativePointer, angle) == 1 ? true : false;
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index c11fb65..a461b29 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -295,13 +295,13 @@ JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectTitleN(JNIEnv * env,
 JNIEXPORT jint JNICALL Java_org_videolan_Libbluray_selectAngleN(JNIEnv * env,
         jclass cls, jlong np, jint angle) {
     BLURAY* bd = (BLURAY*)(intptr_t)np;
-    return bd_select_angle(bd, angle);
+    return bd_select_angle(bd, angle - 1);
 }
 
 JNIEXPORT void JNICALL Java_org_videolan_Libbluray_seamlessAngleChangeN(
         JNIEnv * env, jclass cls, jlong np, jint angle) {
     BLURAY* bd = (BLURAY*)(intptr_t)np;
-    bd_seamless_angle_change(bd, angle);
+    bd_seamless_angle_change(bd, angle - 1);
 }
 
 JNIEXPORT jlong JNICALL Java_org_videolan_Libbluray_getTitleSizeN(JNIEnv * env,



More information about the libbluray-devel mailing list