Work around Android 5 returning 'null' duration for opus files (#7440)
This commit is contained in:
parent
993a1eb171
commit
4990d95f33
|
@ -194,6 +194,7 @@ public class LocalFeedUpdater {
|
|||
try {
|
||||
loadMetadata(item, file, context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
item.setDescriptionIfLonger(e.getMessage());
|
||||
}
|
||||
return item;
|
||||
|
@ -222,7 +223,9 @@ public class LocalFeedUpdater {
|
|||
}
|
||||
|
||||
String durationStr = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||
item.getMedia().setDuration((int) Long.parseLong(durationStr));
|
||||
if (durationStr != null && !durationStr.equals("null")) {
|
||||
item.getMedia().setDuration((int) Long.parseLong(durationStr));
|
||||
}
|
||||
|
||||
item.getMedia().setHasEmbeddedPicture(mediaMetadataRetriever.getEmbeddedPicture() != null);
|
||||
|
||||
|
|
Loading…
Reference in New Issue