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

Commit 967c8f09 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

MediaCodecsXmlParser: append variants instead of replacing

When adding variants for a codec, instead of replacing the existing
ones, append to that list.

MediaCodecXmlParser is first called for media_codecs.xml which has variants
for some of the codecs and then called for media_codecs_performance.xml
which may not contain variant information.

As the variants were replacing the existing ones, variants initilized from
media_codecs.xml were replaced by empty variants parsed from
media_codecs_performance.xml.

This caused an error in Codec2InfoBuilder.cpp as it didn't get the
variants from media_codecs.xml.

Bug: 368244438
Test: adb shell dumpsys media.player on slow-cpu device and verify
c2.android.vp9.encoder and c2.android.hevc.encoder are not listed.

Change-Id: Id04ac95eb87de9f13f304ed7fe7a8ff9f975d7d7
parent 2d27d437
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1069,7 +1069,7 @@ status_t MediaCodecsXmlParser::Impl::Parser::updateMediaCodec(
        codec.rank = rank;
    }

    codec.variantSet = variants;
    codec.variantSet.insert(variants.begin(), variants.end());

    // we allow sets of domains...
    for (const std::string &domain : domains) {