[libbluray-devel] BD-J media player: fix stop()

hpi1 git at videolan.org
Fri May 13 09:31:43 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed May 11 08:51:56 2016 +0300| [84b18d24e99789bc8e0a1fd6fcda9fce44caa80a] | committer: hpi1

BD-J media player: fix stop()

Didn't stop playlist playback.

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

 .../bdj/java/org/videolan/media/content/BDHandler.java          |    6 +++---
 .../bdj/java/org/videolan/media/content/audio/Handler.java      |    7 ++++---
 .../bdj/java/org/videolan/media/content/playlist/Handler.java   |    7 +++++--
 .../bdj/java/org/videolan/media/content/sound/Handler.java      |    6 ++++--
 4 files changed, 16 insertions(+), 10 deletions(-)

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 720089c..a9e25e8 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -372,7 +372,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
 
     protected void doEndOfMediaReached(int playlist) {
         if (state == Started) {
-            ControllerErrorEvent error = doStop();
+            ControllerErrorEvent error = doStop(true);
             if (error == null) {
                 state = Prefetched;
                 notifyListeners(new EndOfMediaEvent(this, Started, Prefetched, Prefetched, getMediaTime()));
@@ -415,7 +415,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
         return null;
     }
 
-    protected ControllerErrorEvent doStop() {
+    protected ControllerErrorEvent doStop(boolean eof) {
         baseMediaTime = getMediaNanoseconds();
         rate = 1.0f;
         return null;
@@ -539,7 +539,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
     private boolean doStopAction() {
         switch (state) {
         case Started:
-            ControllerErrorEvent error = doStop();
+            ControllerErrorEvent error = doStop(false);
             if (error == null) {
                 state = Prefetched;
                 notifyListeners(new StopByRequestEvent(this, Started, Prefetched, Prefetched, getMediaTime()));
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java b/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java
index 9c72523..594eeb1 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/audio/Handler.java
@@ -70,10 +70,11 @@ public class Handler extends BDHandler {
         return super.doStart(at);
     }
 
-    protected ControllerErrorEvent doStop() {
-        return super.doStop();
+    /*
+    protected ControllerErrorEvent doStop(boolean eof) {
+        return super.doStop(eof);
     }
-
+    */
     /*
     protected BDLocator getLocator() {
         return locator;
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
index dcb8966..8134e0c 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/playlist/Handler.java
@@ -198,9 +198,12 @@ public class Handler extends BDHandler {
         }
     }
 
-    protected ControllerErrorEvent doStop() {
+    protected ControllerErrorEvent doStop(boolean eof) {
         Libbluray.selectRate(0.0f, false);
-        return super.doStop();
+        if (!eof) {
+            Libbluray.stopPlaylist();
+        }
+        return super.doStop(eof);
     }
 
     protected void doSeekTime(Time at) {
diff --git a/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java b/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java
index 8768240..d762051 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/sound/Handler.java
@@ -96,9 +96,11 @@ public class Handler extends BDHandler {
         return null;
     }
 
-    protected ControllerErrorEvent doStop() {
-        return super.doStop();
+    /*
+    protected ControllerErrorEvent doStop(boolean eof) {
+        return super.doStop(eof);
     }
+    */
 
     protected BDLocator getLocator() {
         return locator;



More information about the libbluray-devel mailing list