Merge "media: avoid recursion when evaluating profile support" into nyc-dev

am: a72a83a172

* commit 'a72a83a1724d1a2b047fdbb8ab343db6b9b4b7ae':
  media: avoid recursion when evaluating profile support

Change-Id: I41d6aac773ab5c31b700eea343d9a143934c2f6b
This commit is contained in:
Lajos Molnar
2016-06-01 01:05:30 +00:00
committed by android-build-merger

View File

@@ -591,7 +591,12 @@ public final class MediaCodecInfo {
}
}
levelCaps = createFromProfileLevel(mMime, profile, maxLevel);
if (levelCaps != null && !levelCaps.isFormatSupported(format)) {
// remove profile from this format otherwise levelCaps.isFormatSupported will
// get into this same conditon and loop forever.
Map<String, Object> mapWithoutProfile = new HashMap<>(map);
mapWithoutProfile.remove(MediaFormat.KEY_PROFILE);
MediaFormat formatWithoutProfile = new MediaFormat(mapWithoutProfile);
if (levelCaps != null && !levelCaps.isFormatSupported(formatWithoutProfile)) {
return false;
}
}