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

Commit 597ac9f8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "When surround setting is ALWAYS, report all surround formats."

parents b6549b62 dd601156
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -5595,6 +5595,11 @@ void AudioPolicyManager::filterSurroundFormats(FormatVector *formatsPtr) {
            case AUDIO_FORMAT_E_AC3:
            case AUDIO_FORMAT_DTS:
            case AUDIO_FORMAT_DTS_HD:
                // If ALWAYS, remove all other surround formats here since we will add them later.
                if (forceUse == AUDIO_POLICY_FORCE_ENCODED_SURROUND_ALWAYS) {
                    formats.removeAt(formatIndex);
                    formatIndex--;
                }
                supportsOtherSurround = true;
                break;
            case AUDIO_FORMAT_IEC61937:
@@ -5640,8 +5645,7 @@ void AudioPolicyManager::filterSurroundFormats(FormatVector *formatsPtr) {
        // If ALWAYS, add support for raw surround formats if all are missing.
        // This assumes that if any of these formats are reported by the HAL
        // then the report is valid and should not be modified.
        if ((forceUse == AUDIO_POLICY_FORCE_ENCODED_SURROUND_ALWAYS)
                && !supportsOtherSurround) {
        if (forceUse == AUDIO_POLICY_FORCE_ENCODED_SURROUND_ALWAYS) {
            formats.add(AUDIO_FORMAT_E_AC3);
            formats.add(AUDIO_FORMAT_DTS);
            formats.add(AUDIO_FORMAT_DTS_HD);