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

Commit 45490af0 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix AudioRecord

Bug: 7965744
Change-Id: Ic024e7fb32f7459b8093c2cf6cd5752aade21ddb
parent 95819503
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ status_t AudioRecord::set(
        ALOGE("Invalid format");
        return BAD_VALUE;
    }
    mFormat = format;

    if (!audio_is_input_channel(channelMask)) {
        return BAD_VALUE;
@@ -172,7 +173,7 @@ status_t AudioRecord::set(
    uint32_t channelCount = popcount(channelMask);
    mChannelCount = channelCount;

    if (audio_is_linear_pcm(mFormat)) {
    if (audio_is_linear_pcm(format)) {
        mFrameSize = channelCount * audio_bytes_per_sample(format);
    } else {
        mFrameSize = sizeof(uint8_t);
@@ -226,7 +227,6 @@ status_t AudioRecord::set(

    mStatus = NO_ERROR;

    mFormat = format;
    // Update buffer size in case it has been limited by AudioFlinger during track creation
    mFrameCount = mCblk->frameCount_;