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
11e488e1
Commit
11e488e1
authored
Aug 01, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: Use better error detection for WaitForSingleObject().
parent
1aac650c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
miniaudio.h
miniaudio.h
+6
-6
No files found.
miniaudio.h
View file @
11e488e1
...
@@ -13580,7 +13580,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -13580,7 +13580,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
if (pMappedDeviceBufferPlayback == NULL) {
if (pMappedDeviceBufferPlayback == NULL) {
/* WASAPI is weird with exclusive mode. You need to wait on the event _before_ querying the available frames. */
/* WASAPI is weird with exclusive mode. You need to wait on the event _before_ querying the available frames. */
if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE)
== WAIT_FAILED
) {
if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE)
!= WAIT_OBJECT_0
) {
return MA_ERROR; /* Wait failed. */
return MA_ERROR; /* Wait failed. */
}
}
}
}
...
@@ -13604,7 +13604,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -13604,7 +13604,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
if (framesAvailablePlayback == 0) {
if (framesAvailablePlayback == 0) {
/* In exclusive mode we waited at the top. */
/* In exclusive mode we waited at the top. */
if (pDevice->playback.shareMode != ma_share_mode_exclusive) {
if (pDevice->playback.shareMode != ma_share_mode_exclusive) {
if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE)
== WAIT_FAILED
) {
if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE)
!= WAIT_OBJECT_0
) {
return MA_ERROR; /* Wait failed. */
return MA_ERROR; /* Wait failed. */
}
}
}
}
...
@@ -13629,7 +13629,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -13629,7 +13629,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
/* Try grabbing some captured data if we haven't already got a mapped buffer. */
/* Try grabbing some captured data if we haven't already got a mapped buffer. */
if (pMappedDeviceBufferCapture == NULL) {
if (pMappedDeviceBufferCapture == NULL) {
if (pDevice->capture.shareMode == ma_share_mode_shared) {
if (pDevice->capture.shareMode == ma_share_mode_shared) {
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE)
== WAIT_FAILED
) {
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE)
!= WAIT_OBJECT_0
) {
return MA_ERROR; /* Wait failed. */
return MA_ERROR; /* Wait failed. */
}
}
}
}
...
@@ -13646,7 +13646,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -13646,7 +13646,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
if (framesAvailableCapture == 0) {
if (framesAvailableCapture == 0) {
/* In exclusive mode we waited at the top. */
/* In exclusive mode we waited at the top. */
if (pDevice->capture.shareMode != ma_share_mode_shared) {
if (pDevice->capture.shareMode != ma_share_mode_shared) {
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE)
== WAIT_FAILED
) {
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE)
!= WAIT_OBJECT_0
) {
return MA_ERROR; /* Wait failed. */
return MA_ERROR; /* Wait failed. */
}
}
}
}
...
@@ -13889,7 +13889,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -13889,7 +13889,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
DWORD flagsCapture; /* Passed to IAudioCaptureClient_GetBuffer(). */
DWORD flagsCapture; /* Passed to IAudioCaptureClient_GetBuffer(). */
/* Wait for data to become available first. */
/* Wait for data to become available first. */
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE)
== WAIT_FAILED
) {
if (WaitForSingleObject(pDevice->wasapi.hEventCapture, INFINITE)
!= WAIT_OBJECT_0
) {
exitLoop = MA_TRUE;
exitLoop = MA_TRUE;
break; /* Wait failed. */
break; /* Wait failed. */
}
}
...
@@ -13987,7 +13987,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
...
@@ -13987,7 +13987,7 @@ static ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
ma_uint32 framesAvailablePlayback;
ma_uint32 framesAvailablePlayback;
/* Wait for space to become available first. */
/* Wait for space to become available first. */
if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE)
== WAIT_FAILED
) {
if (WaitForSingleObject(pDevice->wasapi.hEventPlayback, INFINITE)
!= WAIT_OBJECT_0
) {
exitLoop = MA_TRUE;
exitLoop = MA_TRUE;
break; /* Wait failed. */
break; /* Wait failed. */
}
}
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