Skip to content

Commit

Permalink
Merge pull request #59 from asakahara/master
Browse files Browse the repository at this point in the history
Add error handling to getting video resolution
  • Loading branch information
MasayukiSuda authored Jan 6, 2020
2 parents ae0516d + 4f1798d commit ca6066c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,15 @@ private Size getVideoResolution(DataSource dataSource) {
final int height = Integer.valueOf(rawHeight);

return new Size(width, height);
} catch (IllegalArgumentException e) {
logger.error("MediaMetadataRetriever", "getVideoResolution IllegalArgumentException", e);
return null;
} catch (RuntimeException e) {
logger.error("MediaMetadataRetriever", "getVideoResolution RuntimeException", e);
return null;
} catch (Exception e) {
logger.error("MediaMetadataRetriever", "getVideoResolution Exception", e);
return null;
} finally {
try {
if (retriever != null) {
Expand Down

0 comments on commit ca6066c

Please sign in to comment.