Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ private static synchronized Pair<MediaCodecInfo, CodecCapabilities> getMediaCode
for (int j = 0; j < supportedTypes.length; j++) {
String supportedType = supportedTypes[j];
if (supportedType.equalsIgnoreCase(mimeType)) {
result = Pair.create(info, info.getCapabilitiesForType(supportedType));
codecs.put(mimeType, result);
try {
result = Pair.create(info, info.getCapabilitiesForType(supportedType));
codecs.put(mimeType, result);
} catch (IllegalArgumentException e) {
//Certain devices can report a codec in the supported list but don't really support it.
//getCapabilitiesForType will return IllegalArgument and we shouldn't add it to the list.
continue;
}
return result;
}
}
Expand Down