Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87436bb6 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

media: avoid recursion when evaluating profile support

Bug: 28671284
Bug: 29041205
Change-Id: Ia9b3596a122bd5ba554a4b4ede875ebcadc67b67
parent cd0aa9cd
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;
                }
            }