[libbluray-devel] Improve BD_EVENT_* return value

hpi1 git at videolan.org
Mon May 16 13:44:30 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon May 16 14:32:01 2016 +0300| [cad7a4c1c1ded11294e314ec84bfedf0d8035fb4] | committer: hpi1

Improve BD_EVENT_* return value

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

 src/libbluray/bdj/java/org/videolan/Libbluray.java              |    2 +-
 .../bdj/java/org/videolan/media/content/BDHandler.java          |    5 +++--
 .../bdj/java/org/videolan/media/content/PlayerManager.java      |    7 ++++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/Libbluray.java b/src/libbluray/bdj/java/org/videolan/Libbluray.java
index 1cf601c..a3c7e78 100644
--- a/src/libbluray/bdj/java/org/videolan/Libbluray.java
+++ b/src/libbluray/bdj/java/org/videolan/Libbluray.java
@@ -549,7 +549,7 @@ public class Libbluray {
         case BDJ_EVENT_UO_MASKED:
         case BDJ_EVENT_SEEK:
         case BDJ_EVENT_RATE:
-            PlayerManager.getInstance().onEvent(event, param);
+            result = PlayerManager.getInstance().onEvent(event, param);
             break;
 
         case BDJ_EVENT_PSR102:
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
index 41b176f..f5c2247 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -340,9 +340,10 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
      * notifications from app
      */
 
-    protected void statusEvent(int event, int param) {
-        if (isClosed) return;
+    protected boolean statusEvent(int event, int param) {
+        if (isClosed) return false;
         commandQueue.put(new PlayerAction(this, PlayerAction.ACTION_STATUS, new Integer(event), param));
+        return true;
     }
 
     /*
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java b/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java
index 7019b16..abc5ced 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/PlayerManager.java
@@ -138,14 +138,15 @@ public class PlayerManager {
      *
      */
 
-    public void onEvent(int event, int param) {
+    public boolean onEvent(int event, int param) {
         synchronized (stoppingLock) {
-            if (stopping) return;
+            if (stopping) return false;
             synchronized (playlistPlayerLock) {
                 if (playlistPlayer != null)
-                    playlistPlayer.statusEvent(event, param);
+                    return playlistPlayer.statusEvent(event, param);
             }
         }
+        return false;
     }
 
     private static final Logger logger = Logger.getLogger(PlayerManager.class.getName());



More information about the libbluray-devel mailing list