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

Commit c85df82b authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Permit AudioRecord to support non-linear formats in future

But still restricted to 16-bit PCM currently

Change-Id: I5df0e5033da9144ca73e44addf14a63d31406034
parent 86f04663
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -211,8 +211,11 @@ status_t AudioRecord::set(
    uint32_t channelCount = popcount(channelMask);
    mChannelCount = channelCount;

    // Assumes audio_is_linear_pcm(format), else sizeof(uint8_t)
    if (audio_is_linear_pcm(format)) {
        mFrameSize = channelCount * audio_bytes_per_sample(format);
    } else {
        mFrameSize = sizeof(uint8_t);
    }

    // validate framecount
    size_t minFrameCount = 0;