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

Commit 7b24a6d1 authored by android-build SharedAccount's avatar android-build SharedAccount
Browse files

Merge branch 'eclair' into eclair-release

parents 610b0955 91487425
Loading
Loading
Loading
Loading
−35.5 KiB (17.6 KiB)
Loading image diff...
−22.4 KiB (16.7 KiB)
Loading image diff...
+11.3 KiB (34.4 KiB)
Loading image diff...
+7.56 KiB (67.7 KiB)
Loading image diff...
+6 −5
Original line number Diff line number Diff line
@@ -501,7 +501,8 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV
    }
    int numChannels = sample->numChannels();
    uint32_t sampleRate = uint32_t(float(sample->sampleRate()) * rate + 0.5);
    uint32_t bufferFrames = (afFrameCount * sampleRate) / afSampleRate;
    uint32_t totalFrames = (kDefaultBufferCount * afFrameCount * sampleRate) / afSampleRate;
    uint32_t bufferFrames = (totalFrames + (kDefaultBufferCount - 1)) / kDefaultBufferCount;
    uint32_t frameCount = 0;

    if (loop) {
@@ -510,8 +511,8 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV

#ifndef USE_SHARED_MEM_BUFFER
    // Ensure minimum audio buffer size in case of short looped sample
    if(frameCount < kDefaultBufferCount * bufferFrames) {
        frameCount = kDefaultBufferCount * bufferFrames;
    if(frameCount < totalFrames) {
        frameCount = totalFrames;
    }
#endif