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

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

Revert "Revert "soundpool: update sample rate when reusing audiotrack""

This reverts commit b801f733.

Change-Id: I0f6ee7fc981d65040f32e7852a5f66fd391b329d
parent b801f733
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -743,8 +743,10 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV
            // From now on, AudioTrack callbacks received with previous toggle value will be ignored.
            mToggle = toggle;
            mAudioTrack = newTrack;
            ALOGV("using new track %p for sample %d", newTrack.get(), sample->sampleID());
        } else {
            newTrack = mAudioTrack;
            newTrack->setSampleRate(sampleRate);
            ALOGV("reusing track %p for sample %d", mAudioTrack.get(), sample->sampleID());
        }
        newTrack->setVolume(leftVolume, rightVolume);