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

Commit 845b4712 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Use audio_channel_mask_t more consistently

In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(),
input parameter is channel mask instead of channel count.

Change-Id: I22a1c492113f3e689173c5ab97b2567cff3abe2b
parent c8d5f7d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ static jint android_media_AudioRecord_get_min_buff_size(JNIEnv *env, jobject th
            sampleRateInHertz,
            (audioFormat == javaAudioRecordFields.PCM16 ?
                AUDIO_FORMAT_PCM_16_BIT : AUDIO_FORMAT_PCM_8_BIT),
            nbChannels);
            audio_channel_in_mask_from_count(nbChannels));

    if (result == BAD_VALUE) {
        return 0;
+1 −1
Original line number Diff line number Diff line
@@ -790,7 +790,7 @@ bool AudioGroup::DeviceThread::threadLoop()
    if (AudioTrack::getMinFrameCount(&output, AUDIO_STREAM_VOICE_CALL,
        sampleRate) != NO_ERROR || output <= 0 ||
        AudioRecord::getMinFrameCount(&input, sampleRate,
        AUDIO_FORMAT_PCM_16_BIT, 1) != NO_ERROR || input <= 0) {
        AUDIO_FORMAT_PCM_16_BIT, AUDIO_CHANNEL_IN_MONO) != NO_ERROR || input <= 0) {
        ALOGE("cannot compute frame count");
        return false;
    }