@@ -5192,8 +5192,8 @@ bool AudioFlinger::RecordThread::checkForNewParameters_l()
51925192 reqFormat == mInput ->stream ->common .get_format (&mInput ->stream ->common ) &&
51935193 reqFormat == AUDIO_FORMAT_PCM_16_BIT &&
51945194 ((int )mInput ->stream ->common .get_sample_rate (&mInput ->stream ->common ) <= (2 * reqSamplingRate)) &&
5195- ( popcount (mInput ->stream ->common .get_channels (&mInput ->stream ->common )) < 3 ) &&
5196- (reqChannelCount < 3 )) {
5195+ popcount (mInput ->stream ->common .get_channels (&mInput ->stream ->common )) <= FCC_2 &&
5196+ (reqChannelCount <= FCC_2 )) {
51975197 status = NO_ERROR;
51985198 }
51995199 if (status == NO_ERROR) {
@@ -5270,7 +5270,7 @@ void AudioFlinger::RecordThread::readInputParameters()
52705270 mFrameCount = mInputBytes / mFrameSize ;
52715271 mRsmpInBuffer = new int16_t [mFrameCount * mChannelCount ];
52725272
5273- if (mSampleRate != mReqSampleRate && mChannelCount < 3 && mReqChannelCount < 3 )
5273+ if (mSampleRate != mReqSampleRate && mChannelCount <= FCC_2 && mReqChannelCount <= FCC_2 )
52745274 {
52755275 int channelCount;
52765276 // optmization: if mono to mono, use the resampler in stereo to stereo mode to avoid
@@ -5559,7 +5559,7 @@ audio_io_handle_t AudioFlinger::openInput(uint32_t *pDevices,
55595559 if (inStream == NULL && status == BAD_VALUE &&
55605560 reqFormat == format && format == AUDIO_FORMAT_PCM_16_BIT &&
55615561 (samplingRate <= 2 * reqSamplingRate) &&
5562- (popcount (channels) < 3 ) && (popcount (reqChannels) < 3 )) {
5562+ (popcount (channels) <= FCC_2 ) && (popcount (reqChannels) <= FCC_2 )) {
55635563 ALOGV (" openInput() reopening with proposed sampling rate and channels" );
55645564 status = inHwDev->open_input_stream (inHwDev, *pDevices, &format,
55655565 &channels, &samplingRate,
0 commit comments