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

Commit f2d8e9c0 authored by jiabin's avatar jiabin
Browse files

Use audio_has_proportional_frames when setting up AudioTrack.

When setting up AudioTrack in JNI, using audio_is_linear_pcm to compute
frame count will make IEC61937 track using a bigger buffer. We should use
audio_has_proportional_frames instead.

Bug: 31914407
Test: Play IEC61937 track and check memory size
Change-Id: I2a907db1d8b256076e1c83b47b67684a539deaaa
parent f2c32815
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ android_media_AudioTrack_setup(JNIEnv *env, jobject thiz, jobject weak_this, job

        // compute the frame count
        size_t frameCount;
        if (audio_is_linear_pcm(format)) {
        if (audio_has_proportional_frames(format)) {
            const size_t bytesPerSample = audio_bytes_per_sample(format);
            frameCount = buffSizeInBytes / (channelCount * bytesPerSample);
        } else {