Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
d6a56e40
Commit
d6a56e40
authored
Jan 25, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iOS: A small change to the experimental fix from the previous commit.
parent
9ec38874
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
miniaudio.h
miniaudio.h
+18
-12
No files found.
miniaudio.h
View file @
d6a56e40
...
...
@@ -25995,19 +25995,8 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice)
case AVAudioSessionRouteChangeReasonNewDeviceAvailable:
{
#if defined(MA_DEBUG_OUTPUT)
printf("[Core Audio] Route Changed: AVAudioSessionRouteChangeReasonNewDeviceAvailable
. inputNumberChannels=%d; outputNumberOfChannels=%d.\n", pSession.inputNumberOfChannels, pSession.outputNumberOfChannels
);
printf("[Core Audio] Route Changed: AVAudioSessionRouteChangeReasonNewDeviceAvailable
\n"
);
#endif
m_pDevice->sampleRate = (ma_uint32)pSession.sampleRate;
if (m_pDevice->type == ma_device_type_capture || m_pDevice->type == ma_device_type_duplex) {
m_pDevice->capture.internalChannels = (ma_uint32)pSession.inputNumberOfChannels;
ma_device__post_init_setup(m_pDevice, ma_device_type_capture);
}
if (m_pDevice->type == ma_device_type_playback || m_pDevice->type == ma_device_type_duplex) {
m_pDevice->playback.internalChannels = (ma_uint32)pSession.outputNumberOfChannels;
ma_device__post_init_setup(m_pDevice, ma_device_type_playback);
}
} break;
case AVAudioSessionRouteChangeReasonNoSuitableRouteForCategory:
...
...
@@ -26046,6 +26035,23 @@ static ma_result ma_device__untrack__coreaudio(ma_device* pDevice)
#endif
} break;
}
if (reason == AVAudioSessionRouteChangeReasonNewDeviceAvailable || reason == AVAudioSessionRouteChangeReasonCategoryChange || reason == AVAudioSessionRouteChangeReasonOverride) {
#if defined(MA_DEBUG_OUTPUT)
printf("[Core Audio] Changing Route. inputNumberChannels=%d; outputNumberOfChannels=%d\n", pSession.inputNumberOfChannels, pSession.outputNumberOfChannels);
#endif
m_pDevice->sampleRate = (ma_uint32)pSession.sampleRate;
if (m_pDevice->type == ma_device_type_capture || m_pDevice->type == ma_device_type_duplex) {
m_pDevice->capture.internalChannels = (ma_uint32)pSession.inputNumberOfChannels;
ma_device__post_init_setup(m_pDevice, ma_device_type_capture);
}
if (m_pDevice->type == ma_device_type_playback || m_pDevice->type == ma_device_type_duplex) {
m_pDevice->playback.internalChannels = (ma_uint32)pSession.outputNumberOfChannels;
ma_device__post_init_setup(m_pDevice, ma_device_type_playback);
}
}
}
@end
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment