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
70d74c9d
Commit
70d74c9d
authored
Jun 08, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug where sometimes a notification never gets signalled.
parent
5c26709f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
research/miniaudio_engine.h
research/miniaudio_engine.h
+19
-1
No files found.
research/miniaudio_engine.h
View file @
70d74c9d
...
@@ -7597,6 +7597,12 @@ static ma_result ma_resource_manager_data_buffer_init_internal(ma_resource_manag
...
@@ -7597,6 +7597,12 @@ static ma_result ma_resource_manager_data_buffer_init_internal(ma_resource_manag
if
((
flags
&
MA_DATA_SOURCE_FLAG_WAIT_INIT
)
!=
0
)
{
if
((
flags
&
MA_DATA_SOURCE_FLAG_WAIT_INIT
)
!=
0
)
{
ma_resource_manager_inline_notification_wait_and_uninit
(
&
initNotification
);
ma_resource_manager_inline_notification_wait_and_uninit
(
&
initNotification
);
/* Make sure we return an error if initialization failed on the async thread. */
result
=
ma_resource_manager_data_buffer_result
(
pDataBuffer
);
if
(
result
==
MA_BUSY
)
{
result
=
MA_SUCCESS
;
}
}
}
}
}
}
}
...
@@ -9332,7 +9338,7 @@ static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_m
...
@@ -9332,7 +9338,7 @@ static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_m
/*
/*
First thing we need to do is check whether or not the data buffer is getting deleted. If so we
First thing we need to do is check whether or not the data buffer is getting deleted. If so we
just abort, but making sure we increment the execution pointer
.
just abort, but making sure we increment the execution pointer.
*/
*/
if
(
ma_resource_manager_data_buffer_result
(
pJob
->
loadDataBuffer
.
pDataBuffer
)
!=
MA_BUSY
)
{
if
(
ma_resource_manager_data_buffer_result
(
pJob
->
loadDataBuffer
.
pDataBuffer
)
!=
MA_BUSY
)
{
result
=
MA_INVALID_OPERATION
;
/* The data buffer may be getting deleted before it's even been loaded. */
result
=
MA_INVALID_OPERATION
;
/* The data buffer may be getting deleted before it's even been loaded. */
...
@@ -9374,6 +9380,18 @@ done:
...
@@ -9374,6 +9380,18 @@ done:
}
}
}
}
/*
If at this point the data buffer has not had it's connector initialized, it means the
notification event was never signalled which means we need to signal it here.
*/
if
(
pJob
->
loadDataBuffer
.
pDataBuffer
->
isConnectorInitialized
==
MA_FALSE
)
{
if
(
pJob
->
loadDataBuffer
.
pInitNotification
!=
NULL
)
{
if
(
result
!=
MA_SUCCESS
)
{
ma_async_notification_signal
(
pJob
->
loadDataBuffer
.
pInitNotification
,
MA_NOTIFICATION_FAILED
);
}
}
}
c89atomic_fetch_add_32
(
&
pJob
->
loadDataBuffer
.
pDataBuffer
->
executionPointer
,
1
);
c89atomic_fetch_add_32
(
&
pJob
->
loadDataBuffer
.
pDataBuffer
->
executionPointer
,
1
);
return
result
;
return
result
;
}
}
...
...
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