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
6a09fb9c
Commit
6a09fb9c
authored
Nov 22, 2022
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix non-Windows builds.
parent
a6ec466e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
85 deletions
+106
-85
miniaudio.h
miniaudio.h
+106
-85
No files found.
miniaudio.h
View file @
6a09fb9c
...
@@ -22367,12 +22367,10 @@ static ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type de
...
@@ -22367,12 +22367,10 @@ static ma_result ma_device_reroute__wasapi(ma_device* pDevice, ma_device_type de
return MA_SUCCESS;
return MA_SUCCESS;
}
}
static ma_result ma_device_start__wasapi(ma_device* pDevice)
static ma_result ma_device_start__wasapi
_nolock
(ma_device* pDevice)
{
{
HRESULT hr;
HRESULT hr;
MA_ASSERT(pDevice != NULL);
if (pDevice->pContext->wasapi.hAvrt) {
if (pDevice->pContext->wasapi.hAvrt) {
LPCWSTR pTaskName = ma_to_usage_string__wasapi(pDevice->wasapi.usage);
LPCWSTR pTaskName = ma_to_usage_string__wasapi(pDevice->wasapi.usage);
if (pTaskName) {
if (pTaskName) {
...
@@ -22404,7 +22402,23 @@ static ma_result ma_device_start__wasapi(ma_device* pDevice)
...
@@ -22404,7 +22402,23 @@ static ma_result ma_device_start__wasapi(ma_device* pDevice)
return MA_SUCCESS;
return MA_SUCCESS;
}
}
static ma_result ma_device_stop__wasapi(ma_device* pDevice)
static ma_result ma_device_start__wasapi(ma_device* pDevice)
{
ma_result result;
MA_ASSERT(pDevice != NULL);
/* Wait for any rerouting to finish before attempting to start the device. */
ma_mutex_lock(&pDevice->wasapi.rerouteLock);
{
result = ma_device_start__wasapi_nolock(pDevice);
}
ma_mutex_unlock(&pDevice->wasapi.rerouteLock);
return result;
}
static ma_result ma_device_stop__wasapi_nolock(ma_device* pDevice)
{
{
ma_result result;
ma_result result;
HRESULT hr;
HRESULT hr;
...
@@ -22452,7 +22466,8 @@ static ma_result ma_device_stop__wasapi(ma_device* pDevice)
...
@@ -22452,7 +22466,8 @@ static ma_result ma_device_stop__wasapi(ma_device* pDevice)
if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
if (pDevice->playback.shareMode == ma_share_mode_exclusive) {
WaitForSingleObject(pDevice->wasapi.hEventPlayback, waitTime);
WaitForSingleObject(pDevice->wasapi.hEventPlayback, waitTime);
} else {
}
else {
ma_uint32 prevFramesAvaialablePlayback = (ma_uint32)-1;
ma_uint32 prevFramesAvaialablePlayback = (ma_uint32)-1;
ma_uint32 framesAvailablePlayback;
ma_uint32 framesAvailablePlayback;
for (;;) {
for (;;) {
...
@@ -22506,6 +22521,22 @@ static ma_result ma_device_stop__wasapi(ma_device* pDevice)
...
@@ -22506,6 +22521,22 @@ static ma_result ma_device_stop__wasapi(ma_device* pDevice)
return MA_SUCCESS;
return MA_SUCCESS;
}
}
static ma_result ma_device_stop__wasapi(ma_device* pDevice)
{
ma_result result;
MA_ASSERT(pDevice != NULL);
/* Wait for any rerouting to finish before attempting to stop the device. */
ma_mutex_lock(&pDevice->wasapi.rerouteLock);
{
result = ma_device_stop__wasapi_nolock(pDevice);
}
ma_mutex_unlock(&pDevice->wasapi.rerouteLock);
return result;
}
#ifndef MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS
#ifndef MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS
#define MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS 5000
#define MA_WASAPI_WAIT_TIMEOUT_MILLISECONDS 5000
...
@@ -41182,9 +41213,6 @@ MA_API ma_result ma_device_start(ma_device* pDevice)
...
@@ -41182,9 +41213,6 @@ MA_API ma_result ma_device_start(ma_device* pDevice)
return MA_SUCCESS; /* Already started. */
return MA_SUCCESS; /* Already started. */
}
}
/* Wait for any rerouting to finish before attempting to start the device. */
ma_mutex_lock(&pDevice->wasapi.rerouteLock);
{
ma_mutex_lock(&pDevice->startStopLock);
ma_mutex_lock(&pDevice->startStopLock);
{
{
/* Starting and stopping are wrapped in a mutex which means we can assert that the device is in a stopped or paused state. */
/* Starting and stopping are wrapped in a mutex which means we can assert that the device is in a stopped or paused state. */
...
@@ -41225,8 +41253,6 @@ MA_API ma_result ma_device_start(ma_device* pDevice)
...
@@ -41225,8 +41253,6 @@ MA_API ma_result ma_device_start(ma_device* pDevice)
}
}
}
}
ma_mutex_unlock(&pDevice->startStopLock);
ma_mutex_unlock(&pDevice->startStopLock);
}
ma_mutex_unlock(&pDevice->wasapi.rerouteLock);
return result;
return result;
}
}
...
@@ -41247,9 +41273,6 @@ MA_API ma_result ma_device_stop(ma_device* pDevice)
...
@@ -41247,9 +41273,6 @@ MA_API ma_result ma_device_stop(ma_device* pDevice)
return MA_SUCCESS; /* Already stopped. */
return MA_SUCCESS; /* Already stopped. */
}
}
/* Wait for any rerouting to finish before attempting to stop the device. */
ma_mutex_lock(&pDevice->wasapi.rerouteLock);
{
ma_mutex_lock(&pDevice->startStopLock);
ma_mutex_lock(&pDevice->startStopLock);
{
{
/* Starting and stopping are wrapped in a mutex which means we can assert that the device is in a started or paused state. */
/* Starting and stopping are wrapped in a mutex which means we can assert that the device is in a started or paused state. */
...
@@ -41298,8 +41321,6 @@ MA_API ma_result ma_device_stop(ma_device* pDevice)
...
@@ -41298,8 +41321,6 @@ MA_API ma_result ma_device_stop(ma_device* pDevice)
pDevice->playback.inputCacheRemaining = 0;
pDevice->playback.inputCacheRemaining = 0;
}
}
ma_mutex_unlock(&pDevice->startStopLock);
ma_mutex_unlock(&pDevice->startStopLock);
}
ma_mutex_unlock(&pDevice->wasapi.rerouteLock);
return result;
return result;
}
}
...
@@ -73009,7 +73030,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
...
@@ -73009,7 +73030,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
Temporarily disabled. There is a subtle bug here where front-left and front-right
Temporarily disabled. There is a subtle bug here where front-left and front-right
will be used by the device's channel map, but this is not what we want to use for
will be used by the device's channel map, but this is not what we want to use for
spatialization. Instead we want to use side-left and side-right. I need to figure
spatialization. Instead we want to use side-left and side-right. I need to figure
out a better solution for this. For now, disabling the use
r
of device channel maps.
out a better solution for this. For now, disabling the use of device channel maps.
*/
*/
/*listenerConfig.pChannelMapOut = pEngine->pDevice->playback.channelMap;*/
/*listenerConfig.pChannelMapOut = pEngine->pDevice->playback.channelMap;*/
}
}
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