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

Commit 214f554b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "audio: fix profile of digital device incorrect" into main am: 1a442e92 am: c3bb5fda

parents 5abf1344 c3bb5fda
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -57,14 +57,21 @@ void AudioPort::importAudioPort(const sp<AudioPort>& port, bool force __unused)

void AudioPort::importAudioPort(const audio_port_v7 &port) {
    for (size_t i = 0; i < port.num_audio_profiles; ++i) {
        if (port.audio_profiles[i].format == AUDIO_FORMAT_DEFAULT) {
            // The dynamic format from AudioPort should not be AUDIO_FORMAT_DEFAULT.
            continue;
        }
        sp<AudioProfile> profile = new AudioProfile(port.audio_profiles[i].format,
                ChannelMaskSet(port.audio_profiles[i].channel_masks,
                        port.audio_profiles[i].channel_masks +
                        port.audio_profiles->num_channel_masks),
                        port.audio_profiles[i].num_channel_masks),
                SampleRateSet(port.audio_profiles[i].sample_rates,
                        port.audio_profiles[i].sample_rates +
                        port.audio_profiles[i].num_sample_rates),
                port.audio_profiles[i].encapsulation_type);
        profile->setDynamicFormat(true);
        profile->setDynamicChannels(true);
        profile->setDynamicRate(true);
        if (!mProfiles.contains(profile)) {
            addAudioProfile(profile);
        }