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

Commit be83a90b authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

Merge "AudioMixer: recreate Resampler if the track channel count has changed" into pi-dev

am: 292838cc

Change-Id: I2cfd6d6e1cbd6e538fd99ec5fa28eb829ce7100e
parents 819484f7 292838cc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -192,7 +192,6 @@ bool AudioMixer::setChannelMasks(int name,
    // always recompute for both channel masks even if only one has changed.
    const uint32_t trackChannelCount = audio_channel_count_from_out_mask(trackChannelMask);
    const uint32_t mixerChannelCount = audio_channel_count_from_out_mask(mixerChannelMask);
    const bool mixerChannelCountChanged = track->mMixerChannelCount != mixerChannelCount;

    ALOG_ASSERT((trackChannelCount <= MAX_NUM_CHANNELS_TO_DOWNMIX)
            && trackChannelCount
@@ -213,7 +212,7 @@ bool AudioMixer::setChannelMasks(int name,
    // do it after downmix since track format may change!
    track->prepareForReformat();

    if (track->mResampler.get() != nullptr && mixerChannelCountChanged) {
    if (track->mResampler.get() != nullptr) {
        // resampler channels may have changed.
        const uint32_t resetToSampleRate = track->sampleRate;
        track->mResampler.reset(nullptr);