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

Commit cd4c6d92 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "policy_hal: allow direct output only for music streams"

parents d42c0be1 753b1f31
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1714,9 +1714,10 @@ audio_io_handle_t AudioPolicyManagerCustom::getOutputForDevice(
        ((offloadInfo->usage == AUDIO_USAGE_MEDIA) || (offloadInfo->usage == AUDIO_USAGE_GAME))) {
        audio_output_flags_t old_flags = flags;
        flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_DIRECT);
        ALOGD("AudioCustomHAL --> Force Direct Flag .. old flags(0x%x)", old_flags);
    } else if (flags == AUDIO_OUTPUT_FLAG_DIRECT && offload_disabled) {
        ALOGD("AudioCustomHAL --> offloading is disabled: Force Remove Direct Flag");
        ALOGD("Force Direct Flag .. old flags(0x%x)", old_flags);
    } else if (flags == AUDIO_OUTPUT_FLAG_DIRECT &&
                (offload_disabled || stream != AUDIO_STREAM_MUSIC)) {
        ALOGD("Offloading is disabled or Stream is not music --> Force Remove Direct Flag");
        flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_NONE);
    }