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
c3e2038c
Commit
c3e2038c
authored
Jun 14, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a crash trying to seek on a failed async data stream.
parent
9be52c70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
research/ma_engine.c
research/ma_engine.c
+4
-4
research/ma_engine.h
research/ma_engine.h
+5
-0
No files found.
research/ma_engine.c
View file @
c3e2038c
...
...
@@ -34,13 +34,13 @@ int main(int argc, char** argv)
#if 1
result
=
ma_engine_sound_init_from_file
(
&
engine
,
argv
[
1
]
,
MA_DATA_SOURCE_FLAG_DECODE
|
MA_DATA_SOURCE_FLAG_ASYNC
|
MA_DATA_SOURCE_FLAG_STREAM
,
NULL
,
&
sound
);
result
=
ma_engine_sound_init_from_file
(
&
engine
,
/*argv[1]*/
"unknownfile.wav"
,
MA_DATA_SOURCE_FLAG_DECODE
|
MA_DATA_SOURCE_FLAG_ASYNC
|
MA_DATA_SOURCE_FLAG_STREAM
,
NULL
,
&
sound
);
if
(
result
!=
MA_SUCCESS
)
{
ma_engine_uninit
(
&
engine
);
return
-
1
;
}
/*ma_data_source_seek_to_pcm_frame(sound.pDataSource, 5000000);*/
ma_data_source_seek_to_pcm_frame
(
sound
.
pDataSource
,
5000000
);
ma_engine_sound_set_volume
(
&
engine
,
&
sound
,
0
.
25
f
);
ma_engine_sound_set_pitch
(
&
engine
,
&
sound
,
1
.
0
f
);
...
...
@@ -51,8 +51,8 @@ int main(int argc, char** argv)
#if 1
/*ma_engine_play_sound(&engine, argv[1], NULL);*/
ma_engine_play_sound
(
&
engine
,
argv
[
2
],
NULL
);
ma_engine_play_sound
(
&
engine
,
argv
[
3
],
NULL
);
/*
ma_engine_play_sound(&engine, argv[2], NULL);
ma_engine_play_sound(&engine, argv[3], NULL);
*/
#endif
#if 0
...
...
research/ma_engine.h
View file @
c3e2038c
...
...
@@ -3143,6 +3143,11 @@ static ma_result ma_resource_manager_handle_message__seek_data_stream(ma_resourc
MA_ASSERT
(
pResourceManager
!=
NULL
);
MA_ASSERT
(
pDataStream
!=
NULL
);
/* For streams the status should be MA_SUCCESS for this to do anything. */
if
(
pDataStream
->
result
!=
MA_SUCCESS
||
pDataStream
->
isDecoderInitialized
==
MA_FALSE
)
{
return
MA_INVALID_OPERATION
;
}
/*
With seeking we just assume both pages are invalid and the relative frame cursor at at position 0. This is basically exactly the same as loading, except
instead of initializing the decoder, we seek to a frame.
...
...
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