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
b2cabfbe
Commit
b2cabfbe
authored
Jun 06, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly respect the WAIT_INIT flag.
parent
7d00be85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
research/miniaudio_engine.h
research/miniaudio_engine.h
+17
-1
No files found.
research/miniaudio_engine.h
View file @
b2cabfbe
...
@@ -7565,12 +7565,24 @@ static ma_result ma_resource_manager_data_buffer_init_internal(ma_resource_manag
...
@@ -7565,12 +7565,24 @@ static ma_result ma_resource_manager_data_buffer_init_internal(ma_resource_manag
/* Loading synchronously or the data has already been fully loaded. We can just initialize the connector from here without a job. */
/* Loading synchronously or the data has already been fully loaded. We can just initialize the connector from here without a job. */
result
=
ma_resource_manager_data_buffer_init_connector
(
pDataBuffer
,
NULL
);
result
=
ma_resource_manager_data_buffer_init_connector
(
pDataBuffer
,
NULL
);
c89atomic_exchange_i32
(
&
pDataBuffer
->
result
,
result
);
c89atomic_exchange_i32
(
&
pDataBuffer
->
result
,
result
);
if
(
pNotification
!=
NULL
)
{
ma_async_notification_signal
(
pNotification
,
(
result
==
MA_SUCCESS
)
?
MA_NOTIFICATION_COMPLETE
:
MA_NOTIFICATION_FAILED
);
}
}
else
{
}
else
{
/* The node's data supply isn't initialized yet. The caller has requested that we load asynchronously so we need to post a job to do this. */
/* The node's data supply isn't initialized yet. The caller has requested that we load asynchronously so we need to post a job to do this. */
ma_job
job
=
ma_job_init
(
MA_JOB_LOAD_DATA_BUFFER
);
ma_job
job
;
ma_resource_manager_inline_notification
initNotification
;
/* Used when the WAIT_INIT flag is set. */
if
((
flags
&
MA_DATA_SOURCE_FLAG_WAIT_INIT
)
!=
0
)
{
ma_resource_manager_inline_notification_init
(
pResourceManager
,
&
initNotification
);
}
job
=
ma_job_init
(
MA_JOB_LOAD_DATA_BUFFER
);
job
.
order
=
ma_resource_manager_data_buffer_next_execution_order
(
pDataBuffer
);
job
.
order
=
ma_resource_manager_data_buffer_next_execution_order
(
pDataBuffer
);
job
.
loadDataBuffer
.
pDataBuffer
=
pDataBuffer
;
job
.
loadDataBuffer
.
pDataBuffer
=
pDataBuffer
;
job
.
loadDataBuffer
.
pCompletedNotification
=
pNotification
;
job
.
loadDataBuffer
.
pCompletedNotification
=
pNotification
;
job
.
loadDataBuffer
.
pInitNotification
=
((
flags
&
MA_DATA_SOURCE_FLAG_WAIT_INIT
)
!=
0
)
?
&
initNotification
:
NULL
;
result
=
ma_resource_manager_post_job
(
pResourceManager
,
&
job
);
result
=
ma_resource_manager_post_job
(
pResourceManager
,
&
job
);
if
(
result
!=
MA_SUCCESS
)
{
if
(
result
!=
MA_SUCCESS
)
{
...
@@ -7580,6 +7592,10 @@ static ma_result ma_resource_manager_data_buffer_init_internal(ma_resource_manag
...
@@ -7580,6 +7592,10 @@ static ma_result ma_resource_manager_data_buffer_init_internal(ma_resource_manag
}
else
{
}
else
{
/* The job has been posted, so make sure the buffer's status is set to busy. The worker thread will */
/* The job has been posted, so make sure the buffer's status is set to busy. The worker thread will */
c89atomic_exchange_i32
(
&
pDataBuffer
->
result
,
MA_BUSY
);
c89atomic_exchange_i32
(
&
pDataBuffer
->
result
,
MA_BUSY
);
if
((
flags
&
MA_DATA_SOURCE_FLAG_WAIT_INIT
)
!=
0
)
{
ma_resource_manager_inline_notification_wait_and_uninit
(
&
initNotification
);
}
}
}
}
}
...
...
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