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

Commit 954315a1 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Recording of non-linear formats is not supported

Such formats are already rejected in AudioRecord::set()

Change-Id: I5ba1fd9e4cd659e5226c75aa4f63e52f655e0521
parent f36dbfe3
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -60,10 +60,9 @@ status_t AudioRecord::getMinFrameCount(
    // We double the size of input buffer for ping pong use of record buffer.
    size <<= 1;

    if (audio_is_linear_pcm(format)) {
    // Assumes audio_is_linear_pcm(format)
    uint32_t channelCount = popcount(channelMask);
    size /= channelCount * audio_bytes_per_sample(format);
    }

    *frameCount = size;
    return NO_ERROR;
@@ -205,11 +204,8 @@ status_t AudioRecord::set(
    uint32_t channelCount = popcount(channelMask);
    mChannelCount = channelCount;

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

    if (sessionId == 0 ) {
        mSessionId = AudioSystem::newAudioSessionId();