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

Commit 6c693334 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Update channel fields at same place in AudioTrack and AudioRecord"

parents 882469cf e3247bf8
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -293,6 +293,9 @@ status_t AudioTrack::set(
        ALOGE("Invalid channel mask %#x", channelMask);
        return BAD_VALUE;
    }
    mChannelMask = channelMask;
    uint32_t channelCount = popcount(channelMask);
    mChannelCount = channelCount;

    // AudioFlinger does not currently support 8-bit data in shared memory
    if (format == AUDIO_FORMAT_PCM_8_BIT && sharedBuffer != 0) {
@@ -316,10 +319,6 @@ status_t AudioTrack::set(
        flags = (audio_output_flags_t)(flags &~AUDIO_OUTPUT_FLAG_DEEP_BUFFER);
    }

    mChannelMask = channelMask;
    uint32_t channelCount = popcount(channelMask);
    mChannelCount = channelCount;

    if (audio_is_linear_pcm(format)) {
        mFrameSize = channelCount * audio_bytes_per_sample(format);
        mFrameSizeAF = channelCount * sizeof(int16_t);