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

Commit 31eefec8 authored by Weiyin Jiang's avatar Weiyin Jiang Committed by Gerrit - the friendly Code Review server
Browse files

hal: correct offload tear down check due to sw effect

This is a subsidiary bug fix of the following incomplete one.

- audio: don't allow track offloaded if there's active sw effect
- Change-Id: Idf76374a3fd721eee595a8a9f6197a47a3c25e1c

CRs-Fixed: 984621
Change-Id: I8997f49560550d4174e1146340e0cd4d33957b24
parent 869f2013
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -1625,15 +1625,21 @@ audio_io_handle_t AudioPolicyManagerCustom::getOutputForDevice(
    // FIXME: We should check the audio session here but we do not have it in this context.
    // This may prevent offloading in rare situations where effects are left active by apps
    // in the background.
    //
    // Supplementary annotation:
    // For sake of track offload introduced, we need a rollback for both compress offload
    // and track offload use cases.
    if ((flags & (AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_DIRECT_PCM)) &&
                mEffects.isNonOffloadableEffectEnabled()) {
        ALOGD("non offloadable effect is enabled, try with non direct output");
        goto non_direct_output;
    }

    if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) &&
            !mEffects.isNonOffloadableEffectEnabled()) {
    profile = getProfileForDirectOutput(device,
                                       samplingRate,
                                       format,
                                       channelMask,
                                       (audio_output_flags_t)flags);
    }

    if (profile != 0) {