Refactor MediaInfo

This commit is contained in:
Reinhard Pointner 2016-08-10 04:36:38 +08:00
parent 0ef31fc19d
commit c6514b817a
2 changed files with 2 additions and 3 deletions

View File

@ -1024,7 +1024,7 @@ public class MediaBindingBean {
mediaInfo = sharedMediaInfoObjects.computeIfAbsent(inferredMediaFile, f -> {
try {
return new MediaInfo().open(f);
} catch (Exception e) {
} catch (IOException e) {
throw new MediaInfoException(e.getMessage());
}
});

View File

@ -318,8 +318,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
sub.setSubContent(readFile(subtitleFile));
}
try (MediaInfo mi = new MediaInfo()) {
mi.open(videoFile);
try (MediaInfo mi = new MediaInfo().open(videoFile)) {
sub.setMovieFPS(mi.get(StreamKind.Video, 0, "FrameRate"));
sub.setMovieTimeMS(mi.get(StreamKind.General, 0, "Duration"));
} catch (Throwable e) {