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

Commit 43813bce authored by Songyue Han's avatar Songyue Han
Browse files

Native CodecCapabilities: Fix maxSupportedInstances.

max-concurrent-instances field is a String instead of Int in format.

Bug: Bug: 389120542
Test: NativeAMediaCodecInfoTest
Change-Id: Ibc132275fbfa550abf47327860703a14cd851a8a
parent 3bb9ecfe
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -407,9 +407,11 @@ void CodecCapabilities::init(std::vector<ProfileLevel> profLevs, std::vector<uin

    mMaxSupportedInstances = maxConcurrentInstances > 0
            ? maxConcurrentInstances : DEFAULT_MAX_SUPPORTED_INSTANCES;

    int32_t maxInstances = mMaxSupportedInstances;
    capabilitiesInfo->findInt32("max-concurrent-instances", &maxInstances);
    AString maxConcurrentInstancesStr;
    int32_t maxInstances
            = capabilitiesInfo->findString("max-concurrent-instances", &maxConcurrentInstancesStr)
            ? (int32_t)strtol(maxConcurrentInstancesStr.c_str(), NULL, 10)
            : mMaxSupportedInstances;
    mMaxSupportedInstances =
            Range(1, MAX_SUPPORTED_INSTANCES_LIMIT).clamp(maxInstances);