Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
6f3b5b9a by Petri Hintukainen at 2026-01-21T00:57:30+02:00
BD-J: Fix locators from org.bluray.ti.[PlayItemImpl,TitleComponentImpl]

String representation was invalid.

- - - - -
eafef607 by Petri Hintukainen at 2026-01-22T16:24:40+02:00
Improve Java 1.4 compability

- - - - -
32960af1 by Petri Hintukainen at 2026-01-22T16:24:40+02:00
build: build BD-J with the same java compiler it was configured with

Fixes build error when using javac 8

- - - - -
01649be7 by Petri Hintukainen at 2026-01-22T16:24:40+02:00
build: use java 1.4 when available

- - - - -


7 changed files:

- src/libbluray/bdj/build.xml
- src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
- src/libbluray/bdj/java/org/bluray/ti/PlayItemImpl.java
- src/libbluray/bdj/java/org/bluray/ti/TitleComponentImpl.java
- src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java
- src/libbluray/bdj/java/org/videolan/Libbluray.java
- src/libbluray/bdj/meson.build


Changes:

=====================================
src/libbluray/bdj/build.xml
=====================================
@@ -9,6 +9,8 @@
     <property name="src_awt" value=""/>
     <property name="src_asm" value="../../../contrib/asm/src/"/>
     <property name="bootclasspath" value=""/>
+    <property name="javac_path" location=""/>
+    <property name="javac_arg" value=""/>
     <property name="version" value=""/>
     <property name="java_version_asm" value="1.5"/>
     <property name="java_version_bdj" value="1.4"/>
@@ -22,17 +24,23 @@
     <target name="compile" depends="init"
             description="compile the source " >
         <javac srcdir="${src_asm}" destdir="${build}" debug="yes"
+               executable="${javac_path}"
+               fork="yes"
                bootclasspath="${bootclasspath}"
+               includeantruntime="false"
                source="${java_version_asm}" target="${java_version_asm}">
                <compilerarg value="-XDignore.symbol.file"/>
                <compilerarg value="-Xlint:-deprecation"/>
         </javac>
         <javac srcdir="${src}${src_awt}" destdir="${build}" debug="yes"
+               executable="${javac_path}"
+               fork="yes"
                bootclasspath="${bootclasspath}"
+               includeantruntime="false"
                source="${java_version_bdj}" target="${java_version_bdj}">
                <compilerarg value="-XDignore.symbol.file"/>
                <compilerarg value="-Xlint:-deprecation"/>
-               <compilerarg value="-Xlint:-removal"/>
+               <compilerarg value="${javac_arg}"/>
         </javac>
     </target>
     <target name="dist" depends="compile"


=====================================
src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
=====================================
@@ -25,7 +25,7 @@ public class PortingHelper {
 
     public static void stopThread(Thread t) {
         try {
-            Thread.class.getMethod("stop").invoke(t);
+            Thread.class.getMethod("stop", new Class[0]).invoke(t, new 
Object[0]);
         } catch (NoSuchMethodException e) {
             // ignore
         } catch (IllegalAccessException e) {
@@ -37,7 +37,7 @@ public class PortingHelper {
 
     public static void stopThreadGroup(ThreadGroup t) {
         try {
-            ThreadGroup.class.getMethod("stop").invoke(t);
+            ThreadGroup.class.getMethod("stop", new Class[0]).invoke(t, new 
Object[0]);
         } catch (NoSuchMethodException e) {
             // ignore
         } catch (IllegalAccessException e) {


=====================================
src/libbluray/bdj/java/org/bluray/ti/PlayItemImpl.java
=====================================
@@ -51,7 +51,7 @@ public class PlayItemImpl implements PlayItem {
     public Locator getLocator() {
         int title = Libbluray.getCurrentTitle();
         try {
-            return new BDLocator("bd://" + Integer.toHexString(title) + 
".PLAYLIST:" + playlistId + ".ITEM:" + playitemId);
+            return new BDLocator(null, title, playlistId, playitemId, -1, 
null);
         } catch (InvalidLocatorException e) {
             return null;
         }


=====================================
src/libbluray/bdj/java/org/bluray/ti/TitleComponentImpl.java
=====================================
@@ -62,29 +62,24 @@ public class TitleComponentImpl implements TitleComponent {
     }
 
     public Locator getLocator() {
-        String str;
-
-        str = "bd://" + ((TitleImpl)service).getTitleNum() +
-            ".PLAYLIST:" + playlistId +
-            ".ITEM:" + playitemId;
-
+        String tags[] = new String[1];
         if (type.equals(StreamType.AUDIO) && primary)
-            str += ".A1:" + stream_number;
+            tags[0] = "A1:" + stream_number;
         else if (type.equals(StreamType.VIDEO) && primary)
-            str += ".V1:" + stream_number;
+            tags[0] = "V1:" + stream_number;
         else if (type.equals(StreamType.AUDIO) && !primary)
-            str += ".A2:" + stream_number;
+            tags[0] = "A2:" + stream_number;
         else if (type.equals(StreamType.VIDEO) && !primary)
-            str += ".V2:" + stream_number;
+            tags[0] = "V2:" + stream_number;
         else if (type.equals(StreamType.SUBTITLES) && primary)
-            str += ".P:" + stream_number;
+            tags[0] = "P:" + stream_number;
         else {
             System.err.println("Unknown StreamType " + type);
             return null;
         }
 
         try {
-            return new BDLocator(str);
+            return new BDLocator(null, ((TitleImpl)service).getTitleNum(), 
playlistId, playitemId, -1, tags);
         } catch (InvalidLocatorException e) {
             return null;
         }


=====================================
src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java
=====================================
@@ -66,9 +66,8 @@ public class TitleImpl implements Title {
     }
 
     public Locator getLocator() {
-        String url = "bd://" + Integer.toString(titleNum, 16);
         try {
-            return new BDLocator(url);
+            return new BDLocator(null, titleNum, -1);
         } catch (InvalidLocatorException ex) {
             return null;
         }


=====================================
src/libbluray/bdj/java/org/videolan/Libbluray.java
=====================================
@@ -535,14 +535,14 @@ public class Libbluray {
             if (mplsFiles == null) {
                 mplsFiles = new HashMap();
             } else {
-                mpls = (PlaylistInfo)mplsFiles.get(playlist);
+                mpls = (PlaylistInfo)mplsFiles.get(Integer.valueOf(playlist));
                 if (mpls != null) {
                     return mpls;
                 }
             }
             mpls = getPlaylistInfoN(nativePointer, playlist);
             if (mpls != null) {
-                mplsFiles.put(playlist, mpls);
+                mplsFiles.put(Integer.valueOf(playlist), mpls);
             }
             return mpls;
         }


=====================================
src/libbluray/bdj/meson.build
=====================================
@@ -7,19 +7,27 @@ ant = find_program('ant', required: get_option('bdj_jar'), 
disabler: true)
 
 if ant.found() and add_languages('java', native: false, required: 
get_option('bdj_jar'))
     javac_version = meson.get_compiler('java').version()
+    javac_path    = find_program('javac').full_path()
+    javac_arg     = '-Xlint:-deprecation'
     if get_option('java9') and bdj_type == 'j2se'
         if javac_version.version_compare('>= 18.0')
             java_src_version = '1.8'
+            java_src_version_asm = '1.8'
+            javac_arg='-Xlint:-removal'
         elif javac_version.version_compare('>=12.0')
             java_src_version = '1.7'
+            java_src_version_asm = '1.7'
         elif javac_version.version_compare('>=9.0')
             java_src_version = '1.6'
+            java_src_version_asm = '1.6'
         else
-            java_src_version = '1.5' #maybe java_version_bdj=1.4 in that case?
+            java_src_version = '1.4'
+            java_src_version_asm = '1.5'
         endif
     endif
     java_summary = { 'Build BD-J JAR': true,
                      '    javac version': javac_version,
+                     '    javac path': javac_path,
                      '    Java binary version': java_src_version }
 else
     java_summary = { 'Build BD-J JAR': false }
@@ -35,8 +43,10 @@ custom_target('bdj-jar',
               '-Ddist=' + meson.current_build_dir(),
               '-Dbootclasspath=' + get_option('bdj_bootclasspath'),
               '-Dsrc_awt=:' + awt_src,
+              '-Djavac_path=' + javac_path,
+              '-Djavac_arg=' + javac_arg,
               f'-Dversion=@bdj_type@-@libbluray_version@',
-              f'-Djava_version_asm=@java_src_version@',
+              f'-Djava_version_asm=@java_src_version_asm@',
               f'-Djava_version_bdj=@java_src_version@'],
     output: [f'libbluray-@bdj_type@-@[email protected]',
              f'libbluray-awt-@bdj_type@-@[email protected]'],



View it on GitLab: 
https://code.videolan.org/videolan/libbluray/-/compare/30d32610f4426317c1d92b52923d41db9e23b2a0...01649be7cbfc0d51e689b3e5e8ceaa282b799814

-- 
View it on GitLab: 
https://code.videolan.org/videolan/libbluray/-/compare/30d32610f4426317c1d92b52923d41db9e23b2a0...01649be7cbfc0d51e689b3e5e8ceaa282b799814
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
libbluray-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libbluray-devel

Reply via email to