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
0fdbb01a
Commit
0fdbb01a
authored
Aug 24, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WASAPI: Fix a bug with automatic stream routing with loopback devices.
parent
ea3f4f3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
miniaudio.h
miniaudio.h
+9
-8
No files found.
miniaudio.h
View file @
0fdbb01a
...
...
@@ -7050,12 +7050,13 @@ HRESULT STDMETHODCALLTYPE ma_IMMNotificationClient_OnDefaultDeviceChanged(ma_IMM
/*
We don't change the device here - we change it in the worker thread to keep synchronization simple. To do this I'm just setting a flag to
indicate that the default device has changed.
indicate that the default device has changed. Loopback devices are treated as capture devices so we need to do a bit of a dance to handle
that properly.
*/
if (dataFlow == ma_eRender) {
if (dataFlow == ma_eRender
&& pThis->pDevice->type != ma_device_type_loopback
) {
ma_atomic_exchange_32(&pThis->pDevice->wasapi.hasDefaultPlaybackDeviceChanged, MA_TRUE);
}
if (dataFlow == ma_eCapture) {
if (dataFlow == ma_eCapture
|| pThis->pDevice->type == ma_device_type_loopback
) {
ma_atomic_exchange_32(&pThis->pDevice->wasapi.hasDefaultCaptureDeviceChanged, MA_TRUE);
}
...
...
@@ -8315,11 +8316,11 @@ ma_bool32 ma_device_is_reroute_required__wasapi(ma_device* pDevice, ma_device_ty
{
ma_assert(pDevice != NULL);
if (deviceType == ma_device_type_playback
|| deviceType == ma_device_type_loopback
) {
if (deviceType == ma_device_type_playback) {
return pDevice->wasapi.hasDefaultPlaybackDeviceChanged;
}
if (deviceType == ma_device_type_capture) {
if (deviceType == ma_device_type_capture
|| deviceType == ma_device_type_loopback
) {
return pDevice->wasapi.hasDefaultCaptureDeviceChanged;
}
...
...
@@ -8334,10 +8335,10 @@ ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type deviceTyp
return MA_INVALID_ARGS;
}
if (deviceType == ma_device_type_playback
|| deviceType == ma_device_type_loopback
) {
if (deviceType == ma_device_type_playback) {
ma_atomic_exchange_32(&pDevice->wasapi.hasDefaultPlaybackDeviceChanged, MA_FALSE);
}
if (deviceType == ma_device_type_capture) {
if (deviceType == ma_device_type_capture
|| deviceType == ma_device_type_loopback
) {
ma_atomic_exchange_32(&pDevice->wasapi.hasDefaultCaptureDeviceChanged, MA_FALSE);
}
...
...
@@ -8397,7 +8398,7 @@ ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
}
}
if (ma_device_is_reroute_required__wasapi(pDevice, ma_device_type_capture)) {
result = ma_device_reroute__wasapi(pDevice, ma_device_type_capture);
result = ma_device_reroute__wasapi(pDevice,
(pDevice->type == ma_device_type_loopback) ? ma_device_type_loopback :
ma_device_type_capture);
if (result != MA_SUCCESS) {
exitLoop = MA_TRUE;
break;
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