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

am: bf3d1fc245

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

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