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

Commit 43d9b870 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Remove restriction for HAL streams of AUDIO_FORMAT_PCM_16_BIT

Change-Id: I6b89a3ac4b77b9a5a84e3b623987186c3d2db89d
parent c326e1c3
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -43,14 +43,12 @@ ssize_t AudioStreamInSource::negotiate(const NBAIO_Format offers[], size_t numOf
    if (!Format_isValid(mFormat)) {
        mStreamBufferSizeBytes = mStream->common.get_buffer_size(&mStream->common);
        audio_format_t streamFormat = mStream->common.get_format(&mStream->common);
        if (streamFormat == AUDIO_FORMAT_PCM_16_BIT) {
        uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common);
        audio_channel_mask_t channelMask =
                (audio_channel_mask_t) mStream->common.get_channels(&mStream->common);
        mFormat = Format_from_SR_C(sampleRate, popcount(channelMask));
        mFrameSize = Format_frameSize(mFormat);
    }
    }
    return NBAIO_Source::negotiate(offers, numOffers, counterOffers, numCounterOffers);
}

+5 −7
Original line number Diff line number Diff line
@@ -40,14 +40,12 @@ ssize_t AudioStreamOutSink::negotiate(const NBAIO_Format offers[], size_t numOff
    if (!Format_isValid(mFormat)) {
        mStreamBufferSizeBytes = mStream->common.get_buffer_size(&mStream->common);
        audio_format_t streamFormat = mStream->common.get_format(&mStream->common);
        if (streamFormat == AUDIO_FORMAT_PCM_16_BIT) {
        uint32_t sampleRate = mStream->common.get_sample_rate(&mStream->common);
        audio_channel_mask_t channelMask =
                (audio_channel_mask_t) mStream->common.get_channels(&mStream->common);
        mFormat = Format_from_SR_C(sampleRate, popcount(channelMask));
        mFrameSize = Format_frameSize(mFormat);
    }
    }
    return NBAIO_Sink::negotiate(offers, numOffers, counterOffers, numCounterOffers);
}