Skip to content
Commits on Source (4)
2019-??-??: Version 1.1.2
- Add libxml version to pkg-config Requires.private.
2019-04-05: Version 1.1.1
- Enable playback without menus when index.bdmv is missing.
- Improve error resilience and stability.
......
......@@ -157,7 +157,7 @@ AS_IF([test "x$with_libxml2" != "xno"], [
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6],
[with_libxml2=yes; AC_DEFINE([HAVE_LIBXML2], [1],
[Define to 1 if libxml2 is to be used for metadata parsing])])
PACKAGES="$PACKAGES libxml-2.0"
PACKAGES="$PACKAGES libxml-2.0 >= 2.6"
])
dnl FreeType2
......
......@@ -280,8 +280,11 @@ public class BDJClassLoader extends URLClassLoader {
}
public URL getResource(String name) {
URL url;
name = name.replace('\\', '/');
return super.getResource(name);
url = super.getResource(name);
logger.info("getResource(" + name + ") --> " + url);
return url;
}
/* final in J2ME
......@@ -292,8 +295,11 @@ public class BDJClassLoader extends URLClassLoader {
*/
public URL findResource(String name) {
URL url;
name = name.replace('\\', '/');
return super.findResource(name);
url = super.findResource(name);
logger.info("findResource(" + name + ") --> " + url);
return url;
}
public Enumeration findResources(String name) throws IOException {
......@@ -302,8 +308,13 @@ public class BDJClassLoader extends URLClassLoader {
}
public InputStream getResourceAsStream(String name) {
InputStream is;
name = name.replace('\\', '/');
return super.getResourceAsStream(name);
is = super.getResourceAsStream(name);
if (is == null) {
logger.info("getResourceAsStream(" + name + ") failed");
}
return is;
}
private String xletClass;
......
......@@ -253,15 +253,40 @@ public class Handler extends BDHandler {
}
}
protected void doChapterReached(int param) {
((PlaybackControlImpl)controls[9]).onChapterReach(param);
BDLocator lastMarkLocator = null;
protected void doChapterReached(int chapter) {
if (chapter <= 0)
return;
chapter--;
synchronized (this) {
if (pi == null)
return;
org.videolan.TIMark[] marks = pi.getMarks();
if (marks == null)
return;
for (int i = 0, j = 0; i < marks.length; i++) {
if (marks[i].getType() == org.videolan.TIMark.MARK_TYPE_ENTRY) {
if (j == chapter) {
if (currentLocator == null || lastMarkLocator != currentLocator || i != currentLocator.getMarkId()) {
((PlaybackControlImpl)controls[9]).onMarkReach(i);
}
return;
}
j++;
}
}
}
}
protected void doMarkReached(int param) {
synchronized (this) {
((PlaybackControlImpl)controls[9]).onMarkReach(param);
if (currentLocator != null)
currentLocator.setMarkId(param);
lastMarkLocator = currentLocator;
}
}
protected void doPlaylistStarted(int param) {
......
......@@ -95,27 +95,6 @@ public class PlaybackControlImpl implements PlaybackControl {
player.seekPlayItem(item);
}
protected void onChapterReach(int chapter) {
if (chapter <= 0)
return;
chapter--;
PlaylistInfo pi = player.getPlaylistInfo();
if (pi == null)
return;
TIMark[] marks = pi.getMarks();
if (marks == null)
return;
for (int i = 0, j = 0; i < marks.length; i++) {
if (marks[i].getType() == TIMark.MARK_TYPE_ENTRY) {
if (j == chapter) {
notifyListeners(new PlaybackMarkEvent(this, i));
return;
}
j++;
}
}
}
protected void onMarkReach(int mark) {
if (mark < 0) {
return;
......