Refactor MediaInfo
This commit is contained in:
parent
0ef31fc19d
commit
c6514b817a
|
@ -1024,7 +1024,7 @@ public class MediaBindingBean {
|
||||||
mediaInfo = sharedMediaInfoObjects.computeIfAbsent(inferredMediaFile, f -> {
|
mediaInfo = sharedMediaInfoObjects.computeIfAbsent(inferredMediaFile, f -> {
|
||||||
try {
|
try {
|
||||||
return new MediaInfo().open(f);
|
return new MediaInfo().open(f);
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
throw new MediaInfoException(e.getMessage());
|
throw new MediaInfoException(e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -318,8 +318,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
|
||||||
sub.setSubContent(readFile(subtitleFile));
|
sub.setSubContent(readFile(subtitleFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
try (MediaInfo mi = new MediaInfo()) {
|
try (MediaInfo mi = new MediaInfo().open(videoFile)) {
|
||||||
mi.open(videoFile);
|
|
||||||
sub.setMovieFPS(mi.get(StreamKind.Video, 0, "FrameRate"));
|
sub.setMovieFPS(mi.get(StreamKind.Video, 0, "FrameRate"));
|
||||||
sub.setMovieTimeMS(mi.get(StreamKind.General, 0, "Duration"));
|
sub.setMovieTimeMS(mi.get(StreamKind.General, 0, "Duration"));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
Loading…
Reference in New Issue