Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
eeac8296 by Petri Hintukainen at 2026-01-22T16:25:58+02:00
org.bluray.ti.PlayListImpl: lazy load playlist data

It is used very rarely, so this avoids reading lot of mpls and clpi files.

- - - - -
b30aacd7 by Petri Hintukainen at 2026-01-23T15:46:45+02:00
BD-J: Fix BDGraphics.constrain()

Current origin was ignored on first call.

- - - - -


2 changed files:

- src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
- src/libbluray/bdj/java/org/bluray/ti/PlayListImpl.java


Changes:

=====================================
src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
=====================================
@@ -280,14 +280,14 @@ abstract class BDGraphicsBase extends DVBGraphics 
implements ConstrainableGraphi
     }
 
     public void constrain(int x, int y, int w, int h) {
-        Rectangle rect;
-        if (constrainedRect != null)
-            rect = constrainedRect;
-        else
-            rect = new Rectangle(0, 0, width, height);
-        constrainedRect = rect.intersection(new Rectangle(rect.x + x, rect.y + 
y, w, h));
-        originX = constrainedRect.x;
-        originY = constrainedRect.y;
+        originX += x;
+        originY += y;
+        Rectangle r = new Rectangle(originX, originY, w, h);
+        if (constrainedRect != null) {
+            constrainedRect = constrainedRect.intersection(r);
+        } else {
+            constrainedRect = r;
+        }
         setupClip();
     }
 


=====================================
src/libbluray/bdj/java/org/bluray/ti/PlayListImpl.java
=====================================
@@ -34,7 +34,6 @@ public class PlayListImpl implements PlayList {
     protected PlayListImpl(String filename, Title service) {
         this.filename = filename;
         this.id = Integer.parseInt(filename);
-        this.playlist = Libbluray.getPlaylistInfo(id);
         this.service = service;
     }
 
@@ -47,7 +46,14 @@ public class PlayListImpl implements PlayList {
     }
 
     public PlayItem[] getPlayItems() {
+        PlaylistInfo playlist = Libbluray.getPlaylistInfo(id);
+        if (playlist == null)
+            return new PlayItemImpl[0];
+
         TIClip[] clips = playlist.getClips();
+        if (clips == null)
+            return new PlayItemImpl[0];
+
         PlayItem[] items = new PlayItem[clips.length];
 
         for (int i = 0; i < clips.length; i++) {
@@ -76,7 +82,6 @@ public class PlayListImpl implements PlayList {
     }
 
     private String filename;
-    private PlaylistInfo playlist;
     private int id;
     private Title service;
 }



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

-- 
View it on GitLab: 
https://code.videolan.org/videolan/libbluray/-/compare/01649be7cbfc0d51e689b3e5e8ceaa282b799814...b30aacd7078eb31d9174aa4295aa0bc08b20d8a5
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