[libbluray-devel] Clear overlay when new title starts

hpi1 git at videolan.org
Sun May 26 12:21:14 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu May 23 17:00:00 2013 +0300| [6d528117990a9c70d256299cc725475aab147ec8] | committer: hpi1

Clear overlay when new title starts

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

 src/libbluray/bdj/java/java/awt/BDRootWindow.java   |   10 ++++++++++
 src/libbluray/bdj/java/org/videolan/GUIManager.java |    2 ++
 2 files changed, 12 insertions(+)

diff --git a/src/libbluray/bdj/java/java/awt/BDRootWindow.java b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
index 75604b5..2491e1d 100644
--- a/src/libbluray/bdj/java/java/awt/BDRootWindow.java
+++ b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
@@ -131,6 +131,16 @@ public class BDRootWindow extends Frame {
         }
     }
 
+    /* called when new title starts (window is "created" again) */
+    public void clearOverlay() {
+        if (overlay_open) {
+            org.videolan.Logger.getLogger("BDRootWindow").error("clearOverlay() ignored (overlay is visible)");
+        } else {
+            Arrays.fill(backBuffer, 0);
+            dirty.clear();
+        }
+    }
+
     public void dispose()
     {
         if (isVisible()) {
diff --git a/src/libbluray/bdj/java/org/videolan/GUIManager.java b/src/libbluray/bdj/java/org/videolan/GUIManager.java
index 8448a83..89d5845 100644
--- a/src/libbluray/bdj/java/org/videolan/GUIManager.java
+++ b/src/libbluray/bdj/java/org/videolan/GUIManager.java
@@ -33,6 +33,8 @@ public class GUIManager extends BDRootWindow {
     public static synchronized GUIManager createInstance() {
         if (instance == null) {
             instance = new GUIManager();
+        } else {
+            instance.clearOverlay();
         }
         return instance;
     }



More information about the libbluray-devel mailing list