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

Commit 02743e21 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Audio policy: Use surround formats from audio config instead of hardcoded

This is a follow-up to ag/3835377, where the intention was to
use SURROND_FORMATS array, which is lately been replaced by
an array from APM's config.

Bug: 67479735
Bug: 117602867
Test: make
Change-Id: I31f63856d8fb06ff9ac0f03b9ec1600f0fcee30b
parent e4eb88fa
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -5895,18 +5895,8 @@ void AudioPolicyManager::filterSurroundFormats(FormatVector *formatsPtr) {
            // Add reported surround sound formats to enabled surround formats.
            for (size_t formatIndex = 0; formatIndex < formats.size(); formatIndex++) {
                audio_format_t format = formats[formatIndex];
                switch(format) {
                    case AUDIO_FORMAT_AC3:
                    case AUDIO_FORMAT_E_AC3:
                    case AUDIO_FORMAT_DTS:
                    case AUDIO_FORMAT_DTS_HD:
                    case AUDIO_FORMAT_AAC_LC:
                    case AUDIO_FORMAT_DOLBY_TRUEHD:
                    case AUDIO_FORMAT_E_AC3_JOC:
                if (mConfig.getSurroundFormats().count(format) != 0) {
                    mSurroundFormats.insert(format);
                        break;
                    default:
                        break;
                }
            }
        }