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
07ae0be2
Commit
07ae0be2
authored
Aug 25, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resource Manager: Fix a bug when reusing an already-loaded data buffer.
parent
d83b3886
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
research/ma_engine.c
research/ma_engine.c
+12
-1
research/ma_engine.h
research/ma_engine.h
+6
-0
No files found.
research/ma_engine.c
View file @
07ae0be2
...
...
@@ -30,6 +30,7 @@ int main(int argc, char** argv)
ma_result
result
;
ma_engine
engine
;
ma_sound
sound
;
ma_sound
sound2
;
sound_loaded_notification
loadNotification
;
...
...
@@ -49,7 +50,14 @@ int main(int argc, char** argv)
loadNotification
.
cb
.
onSignal
=
on_sound_loaded
;
loadNotification
.
pSound
=
&
sound
;
result
=
ma_sound_init_from_file
(
&
engine
,
argv
[
1
],
MA_DATA_SOURCE_FLAG_DECODE
|
MA_DATA_SOURCE_FLAG_ASYNC
|
MA_DATA_SOURCE_FLAG_STREAM
,
&
loadNotification
,
NULL
,
&
sound
);
result
=
ma_sound_init_from_file
(
&
engine
,
argv
[
1
],
MA_DATA_SOURCE_FLAG_DECODE
/*| MA_DATA_SOURCE_FLAG_ASYNC | MA_DATA_SOURCE_FLAG_STREAM*/
,
&
loadNotification
,
NULL
,
&
sound
);
if
(
result
!=
MA_SUCCESS
)
{
printf
(
"Failed to load sound: %s
\n
"
,
argv
[
1
]);
ma_engine_uninit
(
&
engine
);
return
-
1
;
}
result
=
ma_sound_init_from_file
(
&
engine
,
argv
[
1
],
MA_DATA_SOURCE_FLAG_DECODE
/*| MA_DATA_SOURCE_FLAG_ASYNC | MA_DATA_SOURCE_FLAG_STREAM*/
,
&
loadNotification
,
NULL
,
&
sound2
);
if
(
result
!=
MA_SUCCESS
)
{
printf
(
"Failed to load sound: %s
\n
"
,
argv
[
1
]);
ma_engine_uninit
(
&
engine
);
...
...
@@ -74,6 +82,9 @@ int main(int argc, char** argv)
ma_sound_set_stop_delay
(
&
sound
,
1000
);
ma_sound_start
(
&
sound
);
ma_sleep
(
1000
);
ma_sound_start
(
&
sound2
);
//ma_sleep(2000);
printf
(
"Stopping...
\n
"
);
//ma_sound_stop(&sound);
...
...
research/ma_engine.h
View file @
07ae0be2
...
...
@@ -2197,6 +2197,12 @@ static ma_result ma_resource_manager_data_buffer_init_nolock(ma_resource_manager
return
result
;
/* Should never happen. Failed to increment the reference count. */
}
result
=
ma_resource_manager_data_buffer_init_connector
(
pDataBuffer
);
if
(
result
!=
MA_SUCCESS
)
{
ma_resource_manager_data_buffer_node_free
(
pDataBuffer
->
pResourceManager
,
pDataBuffer
->
pNode
);
return
result
;
}
if
(
pNotification
!=
NULL
)
{
ma_async_notification_signal
(
pNotification
);
}
...
...
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