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

Commit 85395896 authored by Andy Hung's avatar Andy Hung
Browse files

AudioMixer: fix assertion for multichannel playback

Reset mPostDownmixReformatBufferProvider before changing
downmixerBufferProvider.

Test: Play Music with multichannel files
Bug: 27526910
Change-Id: I5803e169cb9da4e7681bc8caf1452e79e5a4d1d5
parent 94cfe137
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -302,6 +302,12 @@ bool AudioMixer::setChannelMasks(int name,
void AudioMixer::track_t::unprepareForDownmix() {
    ALOGV("AudioMixer::unprepareForDownmix(%p)", this);

    if (mPostDownmixReformatBufferProvider != nullptr) {
        // release any buffers held by the mPostDownmixReformatBufferProvider
        // before deallocating the downmixerBufferProvider.
        mPostDownmixReformatBufferProvider->reset();
    }

    mDownmixRequiresFormat = AUDIO_FORMAT_INVALID;
    if (downmixerBufferProvider != NULL) {
        // this track had previously been configured with a downmixer, delete it