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

Commit 2a31f21e authored by Lajos Molnar's avatar Lajos Molnar Committed by Android Git Automerger
Browse files

am 5f244042: Merge "Fix WAVExtractor to output full audio frames only" into lmp-dev

* commit '5f244042':
  Fix WAVExtractor to output full audio frames only
parents f2bd67bc 5f244042
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -439,6 +439,10 @@ status_t WAVSource::read(
        maxBytesToRead = maxBytesAvailable;
    }

    // read only integral amounts of audio unit frames.
    const size_t inputUnitFrameSize = mNumChannels * mBitsPerSample / 8;
    maxBytesToRead -= maxBytesToRead % inputUnitFrameSize;

    if (mWaveFormat == WAVE_FORMAT_MSGSM) {
        // Microsoft packs 2 frames into 65 bytes, rather than using separate 33-byte frames,
        // so read multiples of 65, and use smaller buffers to account for ~10:1 expansion ratio