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

Commit b9abf6c3 authored by Dhananjay Kumar's avatar Dhananjay Kumar Committed by Steve Kondik
Browse files

soundpool: update sample rate when reusing audiotrack

User might update playback rate while calling Play on a sample.
Update sample rate if reusing existing audio track.

Change-Id: I7007c335fa405baf663a322408b92b9df53efdb0
parent 124daae8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -649,6 +649,7 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV
            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);