[libbluray-devel] [Git][videolan/libbluray][master] 3 commits: Fix build with Java 8 (broken in 3187c3)

Petri Hintukainen (@hpi) gitlab at videolan.org
Sat Aug 6 17:38:59 UTC 2022



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
baa27f07 by hpi1 at 2022-08-06T20:01:24+03:00
Fix build with Java 8 (broken in 3187c3)

- - - - -
f8d914f8 by hpi1 at 2022-08-06T20:01:24+03:00
Drop unneeded function

- - - - -
e99df3ad by hpi1 at 2022-08-06T20:01:24+03:00
Avoid changing player state in _fill_disc_info()

- - - - -


4 changed files:

- src/libbluray/bdj/java/org/videolan/Libbluray.java
- src/libbluray/bdj/native/org_videolan_Libbluray.c
- src/libbluray/bluray.c
- src/libbluray/bluray_internal.h


Changes:

=====================================
src/libbluray/bdj/java/org/videolan/Libbluray.java
=====================================
@@ -25,6 +25,7 @@ import java.awt.BDToolkit;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
 import java.io.File;
+import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Vector;
@@ -150,9 +151,10 @@ public class Libbluray {
              */
             System.err.println("Detected Java >= 18, trying setSecurityManager() workaround");
             try {
-                java.lang.reflect.Method method = System.class.getDeclaredMethod("implSetSecurityManager", SecurityManager.class);
+                Method method = System.class.getDeclaredMethod("implSetSecurityManager",
+                                                              new Class [] { SecurityManager.class });
                 method.setAccessible(true);
-                method.invoke(null, sm);
+                method.invoke(null, new Object [] { (Object)sm } );
                 return;
             } catch (Exception ex2) {
                 throw ex;


=====================================
src/libbluray/bdj/native/org_videolan_Libbluray.c
=====================================
@@ -218,7 +218,7 @@ JNIEXPORT jbyteArray JNICALL Java_org_videolan_Libbluray_getAacsDataN
   (JNIEnv * env, jclass cls, jlong np, jint type)
 {
     BLURAY* bd = (BLURAY*)(intptr_t)np;
-    const uint8_t *data = bd_get_aacs_data(bd, type);
+    const uint8_t *data = disc_get_data(bd_get_disc(bd), type);
     size_t data_size = 16;
 
     BD_DEBUG(DBG_JNI, "getAacsDataN(%d) -> %p\n", (int)type, (const void *)data);


=====================================
src/libbluray/bluray.c
=====================================
@@ -1016,12 +1016,13 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
         index = indx_get(bd->disc);
         if (!index) {
             /* check for incomplete disc */
-            int r = bd_get_titles(bd, 0, 0);
-            if (r > 0) {
+            NAV_TITLE_LIST *title_list = nav_get_title_list(bd->disc, 0, 0);
+            if (title_list && title_list->count > 0) {
                 BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Possible incomplete BluRay image detected. No menu support.\n");
                 bd->disc_info.bluray_detected = 1;
                 bd->disc_info.no_menu_support = 1;
             }
+            nav_free_title_list(&title_list);
         }
     }
 
@@ -1188,11 +1189,6 @@ void bd_set_bdj_uo_mask(BLURAY *bd, unsigned mask)
     _update_uo_mask(bd);
 }
 
-const uint8_t *bd_get_aacs_data(BLURAY *bd, int type)
-{
-    return disc_get_data(bd->disc, type);
-}
-
 uint64_t bd_get_uo_mask(BLURAY *bd)
 {
     /* internal function. Used by BD-J. */


=====================================
src/libbluray/bluray_internal.h
=====================================
@@ -27,8 +27,6 @@
 struct bluray;
 struct bd_disc;
 
-BD_PRIVATE const uint8_t *bd_get_aacs_data(struct bluray *bd, int type);
-
 /*
  * VFS
  */



View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/3187c3080096e107f0a27eed1843232b58342577...e99df3adeb07420b72690ac09a147c8f34876eb8

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/3187c3080096e107f0a27eed1843232b58342577...e99df3adeb07420b72690ac09a147c8f34876eb8
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the libbluray-devel mailing list