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
0e1187c1
Commit
0e1187c1
authored
May 26, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prep work for some future work.
parent
9930fbaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
22 deletions
+19
-22
research/miniaudio_engine.h
research/miniaudio_engine.h
+19
-22
No files found.
research/miniaudio_engine.h
View file @
0e1187c1
...
@@ -6749,35 +6749,32 @@ static ma_result ma_resource_manager_data_buffer_init_nolock(ma_resource_manager
...
@@ -6749,35 +6749,32 @@ static ma_result ma_resource_manager_data_buffer_init_nolock(ma_resource_manager
alternative to this could be to initialize the connector via the job queue when the data
alternative to this could be to initialize the connector via the job queue when the data
source is being loaded asynchronously.
source is being loaded asynchronously.
*/
*/
if
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
)
{
if
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
&&
ma_resource_manager_is_threading_enabled
(
pResourceManager
)
&&
async
)
{
if
(
ma_resource_manager_is_threading_enabled
(
pResourceManager
))
{
/* Loading asynchronously. */
if
(
async
)
{
/* Loading asynchronously. */
/* TODO: This needs to be improved so that when loading asynchronously we post a message to the job queue instead of just waiting. */
if
(
pDataBuffer
->
pNode
->
data
.
type
==
ma_resource_manager_data_buffer_encoding_decoded
)
{
/* TODO: This needs to be improved so that when loading asynchronously we post a message to the job queue instead of just waiting. */
/* For the decoded case we need only wait for the data supplier to be initialized. */
if
(
pDataBuffer
->
pNode
->
data
.
type
==
ma_resource_manager_data_buffer_encoding_decoded
)
{
while
(
pDataBuffer
->
pNode
->
data
.
decoded
.
supplier
==
ma_decoded_data_supplier_unknown
)
{
/* For the decoded case we need only wait for the data supplier to be initialized. */
ma_yield
();
while
(
pDataBuffer
->
pNode
->
data
.
decoded
.
supplier
==
ma_decoded_data_supplier_unknown
)
{
ma_yield
();
}
}
else
{
while
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
)
{
ma_yield
();
}
}
}
else
{
/* Loading synchronously. Wait for the initial sound to be fully decoded. */
while
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
)
{
ma_yield
();
}
}
}
}
else
{
}
else
{
/* Threading is not enabled. We need to spin and call ma_resource_manager_process_next_job(). */
while
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
)
{
while
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
)
{
ma_yield
();
}
}
}
else
{
/* Not loading asychronously. We need to wait for the sound to be fully decoded so we can initialize a connector. */
while
(
ma_resource_manager_data_buffer_node_result
(
pDataBuffer
->
pNode
)
==
MA_BUSY
)
{
if
(
ma_resource_manager_is_threading_enabled
(
pResourceManager
))
{
/* We're not threading, so process the next job if there are any. */
result
=
ma_resource_manager_process_next_job
(
pResourceManager
);
result
=
ma_resource_manager_process_next_job
(
pResourceManager
);
if
(
result
==
MA_NO_DATA_AVAILABLE
||
result
==
MA_JOB_QUIT
)
{
if
(
result
==
MA_NO_DATA_AVAILABLE
||
result
==
MA_JOB_QUIT
)
{
break
;
break
;
}
}
}
else
{
/* We're threading, so just keep spinning until some other thread finishes decoding of the original sound. */
ma_yield
();
}
}
}
}
}
}
...
...
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