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

Commit ca4c68f2 authored by Sunghyun Kwon's avatar Sunghyun Kwon Committed by Marco Nelissen
Browse files

stagefright: fix finding hardware codec

When findMatchingCodecs(.., kHardwareCodecsOnly,..) was called,
it wouldn't actually match any hardware codecs because of a typo:

  if (!(TRUE_prefer_HW_codec && !FALSE_is_SW_codec))
    ==> if (!(TRUE && TRUE))

Fix logic and clarify statements

Change-Id: Ice725f043475caedd8f7ab961e0bc985db2eba6f
parent 84183ba4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,9 @@ void MediaCodecList::findMatchingCodecs(
        CHECK(info != NULL);
        AString componentName = info->getCodecName();

        if (!((flags & kHardwareCodecsOnly) && !isSoftwareCodec(componentName))) {
        if ((flags & kHardwareCodecsOnly) && isSoftwareCodec(componentName)) {
            ALOGV("skipping SW codec '%s'", componentName.c_str());
        } else {
            matches->push(componentName);
            ALOGV("matching '%s'", componentName.c_str());
        }