Refactor MediaInfo
This commit is contained in:
parent
0ef31fc19d
commit
c6514b817a
|
@ -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());
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue