[libbluray-devel] playlist player: fix getServiceContentLocators()
hpi1
git at videolan.org
Sun Apr 17 21:41:59 CEST 2016
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Apr 17 21:54:07 2016 +0300| [5be8391de02293812d94d5a892b3e0cfa4203553] | committer: hpi1
playlist player: fix getServiceContentLocators()
Should return current selection, not source locator
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=5be8391de02293812d94d5a892b3e0cfa4203553
---
.../bdj/java/org/videolan/media/content/BDHandler.java | 8 +-------
.../java/org/videolan/media/content/playlist/Handler.java | 12 ++++++++++++
2 files changed, 13 insertions(+), 7 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 ac00191..77953e0 100644
--- a/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
+++ b/src/libbluray/bdj/java/org/videolan/media/content/BDHandler.java
@@ -54,7 +54,6 @@ import javax.tv.locator.Locator;
import javax.tv.service.selection.ServiceContentHandler;
import org.bluray.media.OverallGainControl;
-import org.bluray.net.BDLocator;
import org.videolan.BDJAction;
import org.videolan.BDJActionManager;
@@ -260,11 +259,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
}
public Locator[] getServiceContentLocators() {
- if (locator == null)
- return new Locator[0];
- Locator[] locators = new Locator[1];
- locators[0] = locator;
- return locators;
+ return new Locator[0];
}
public void realize() {
@@ -706,7 +701,6 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
protected long baseTime;
protected float rate = 1.0f;
protected Control[] controls = null;
- protected BDLocator locator = null;
private BDJListeners listeners = new BDJListeners();
private BDJXletContext ownerContext;
boolean isClosed = false;
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 62c2d2c..1f2bb85 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
@@ -87,6 +87,17 @@ public class Handler extends BDHandler {
}
}
+ public Locator[] getServiceContentLocators() {
+ if (locator == null)
+ return new Locator[0];
+ Locator[] locators = new Locator[1];
+ if (currentLocator != null && getState() >= Prefetched)
+ locators[0] = currentLocator;
+ else
+ locators[0] = locator;
+ return locators;
+ }
+
public Time getDuration() {
long duration = pi.getDuration() ;
return new Time(duration * TO_SECONDS);
@@ -410,4 +421,5 @@ public class Handler extends BDHandler {
private PlaylistInfo pi = null;
private BDLocator currentLocator = null;
+ private BDLocator locator = null;
}
More information about the libbluray-devel
mailing list