* display error message if MediaInfo native library is missing
* include jna in fatjar
This commit is contained in:
parent
4388f47317
commit
23dc93bf20
|
@ -87,6 +87,11 @@
|
||||||
|
|
||||||
<zipfileset src="${dir.lib}/ehcache.jar">
|
<zipfileset src="${dir.lib}/ehcache.jar">
|
||||||
<include name="**/*.class" />
|
<include name="**/*.class" />
|
||||||
|
</zipfileset>
|
||||||
|
|
||||||
|
<zipfileset src="${dir.lib}/jna.jar">
|
||||||
|
<!-- include classes and native libraries -->
|
||||||
|
<include name="com/sun/jna/**" />
|
||||||
</zipfileset>
|
</zipfileset>
|
||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
|
@ -9,6 +9,8 @@ import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import java.util.zip.CRC32;
|
import java.util.zip.CRC32;
|
||||||
|
|
||||||
import net.sf.ehcache.Cache;
|
import net.sf.ehcache.Cache;
|
||||||
|
@ -142,10 +144,18 @@ public class EpisodeFormatBindingBean {
|
||||||
|
|
||||||
public synchronized MediaInfo getMediaInfo() {
|
public synchronized MediaInfo getMediaInfo() {
|
||||||
if (mediaInfo == null) {
|
if (mediaInfo == null) {
|
||||||
mediaInfo = new MediaInfo();
|
try {
|
||||||
|
mediaInfo = new MediaInfo();
|
||||||
if (mediaFile == null || !mediaInfo.open(mediaFile)) {
|
|
||||||
throw new RuntimeException(String.format("Cannot open file: %s", mediaFile));
|
if (mediaFile == null || !mediaInfo.open(mediaFile)) {
|
||||||
|
throw new RuntimeException(String.format("Cannot open file: %s", mediaFile));
|
||||||
|
}
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
// MediaInfo native library is missing -> notify user
|
||||||
|
Logger.getLogger("ui").log(Level.SEVERE, e.getMessage(), e);
|
||||||
|
|
||||||
|
// rethrow error
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue