-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with airpod not getting re-initialized when changing from h…
…ands-free When airpods change from hands-free to full stereo mode, code in the mac handler was determining that there had been a change in channels and was bailing on initialization, even when change in channels works fine for output devices.
- Loading branch information
1 parent
0440132
commit 59124ca
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/modules/audio_device/mac/audio_device_mac.cc b/modules/audio_device/mac/audio_device_mac.cc | ||
index 0a371737b3..e3a902270d 100644 | ||
--- a/modules/audio_device/mac/audio_device_mac.cc | ||
+++ b/modules/audio_device/mac/audio_device_mac.cc | ||
@@ -2096,12 +2096,6 @@ int32_t AudioDeviceMac::HandleStreamFormatChange( | ||
return -1; | ||
} | ||
|
||
- if (_ptrAudioBuffer && streamFormat.mChannelsPerFrame != _recChannels) { | ||
- RTC_LOG(LS_ERROR) << "Changing channels not supported (mChannelsPerFrame = " | ||
- << streamFormat.mChannelsPerFrame << ")"; | ||
- return -1; | ||
- } | ||
- | ||
RTC_LOG(LS_VERBOSE) << "Stream format:"; | ||
RTC_LOG(LS_VERBOSE) << "mSampleRate = " << streamFormat.mSampleRate | ||
<< ", mChannelsPerFrame = " | ||
@@ -2115,6 +2109,12 @@ int32_t AudioDeviceMac::HandleStreamFormatChange( | ||
logCAMsg(rtc::LS_VERBOSE, "mFormatID", (const char*)&streamFormat.mFormatID); | ||
|
||
if (propertyAddress.mScope == kAudioDevicePropertyScopeInput) { | ||
+ if (_ptrAudioBuffer && streamFormat.mChannelsPerFrame != _recChannels) { | ||
+ RTC_LOG(LS_ERROR) << "Changing channels not supported (mChannelsPerFrame = " | ||
+ << streamFormat.mChannelsPerFrame << ")"; | ||
+ return -1; | ||
+ } | ||
+ | ||
const int io_block_size_samples = streamFormat.mChannelsPerFrame * | ||
streamFormat.mSampleRate / 100 * | ||
N_BLOCKS_IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters