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

am: d3560d6c05

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

Change-Id: I32a3f8c7d7f96ced191790ddfacb4405d9474a27
This commit is contained in:
Lajos Molnar
2016-06-01 01:21:47 +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;
}
}