Commit 85a9a2c9 authored by hpi1's avatar hpi1

BDJ: ignore old end of playlist events

parent 08ecda4d
......@@ -372,7 +372,7 @@ public class Libbluray {
if (rate > 0.99f && rate < 1.01f) rate = 1.0f;
PlayerManager.getInstance().onRateChange(rate);
case BDJ_EVENT_END_OF_PLAYLIST:
PlayerManager.getInstance().onPlaylistEnd();
PlayerManager.getInstance().onPlaylistEnd(param);
break;
case BDJ_EVENT_PSR102:
org.bluray.bdplus.Status.getInstance().receive(param);
......
......@@ -321,7 +321,7 @@ public abstract class BDHandler implements Player, ServiceContentHandler {
commandQueue.shutdown();
}
protected void endOfMedia() {
protected void endOfMedia(int playlist) {
if (isClosed) return;
PlayerAction action = new PlayerAction(this, PlayerAction.ACTION_END_OF_MEDIA, null);
......
......@@ -114,10 +114,10 @@ public class PlayerManager {
*
*/
public void onPlaylistEnd() {
public void onPlaylistEnd(int playlist) {
synchronized (playlistPlayerLock) {
if (playlistPlayer != null)
playlistPlayer.endOfMedia();
playlistPlayer.endOfMedia(playlist);
}
}
......
......@@ -226,6 +226,17 @@ public class Handler extends BDHandler {
((PiPControlImpl)controls[8]).onPiPChange(param);
}
protected void endOfMedia(int playlist) {
synchronized (this) {
if (locator == null || locator.getPlayListId() != playlist) {
System.err.println("endOfMedia ignored: playlist does not match (" + playlist + " != " + locator.getPlayListId());
return;
}
}
super.endOfMedia(playlist);
}
protected BDLocator getLocator() {
return locator;
}
......
......@@ -3196,7 +3196,7 @@ static int _read_ext(BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)
}
if (bd->bdj_end_of_playlist == 1) {
_bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, 0);
_bdj_event(bd, BDJ_EVENT_END_OF_PLAYLIST, bd_psr_read(bd->regs, PSR_PLAYLIST));
bd->bdj_end_of_playlist |= 2;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment