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
1b35118e
Commit
1b35118e
authored
Apr 29, 2024
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AAudio: Potential fix for a failed assertion.
Public issue
https://github.com/mackron/miniaudio/issues/833
parent
88436b25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
miniaudio.h
miniaudio.h
+20
-2
No files found.
miniaudio.h
View file @
1b35118e
...
@@ -37736,7 +37736,9 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_capture__aaudio(
...
@@ -37736,7 +37736,9 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_capture__aaudio(
ma_device* pDevice = (ma_device*)pUserData;
ma_device* pDevice = (ma_device*)pUserData;
MA_ASSERT(pDevice != NULL);
MA_ASSERT(pDevice != NULL);
ma_device_handle_backend_data_callback(pDevice, NULL, pAudioData, frameCount);
if (frameCount > 0) {
ma_device_handle_backend_data_callback(pDevice, NULL, pAudioData, (ma_uint32)frameCount);
}
(void)pStream;
(void)pStream;
return MA_AAUDIO_CALLBACK_RESULT_CONTINUE;
return MA_AAUDIO_CALLBACK_RESULT_CONTINUE;
...
@@ -37747,7 +37749,14 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_playback__aaudio
...
@@ -37747,7 +37749,14 @@ static ma_aaudio_data_callback_result_t ma_stream_data_callback_playback__aaudio
ma_device* pDevice = (ma_device*)pUserData;
ma_device* pDevice = (ma_device*)pUserData;
MA_ASSERT(pDevice != NULL);
MA_ASSERT(pDevice != NULL);
ma_device_handle_backend_data_callback(pDevice, pAudioData, NULL, frameCount);
/*
I've had a report that AAudio can sometimes post a frame count of 0. We need to check for that here
so we don't get any errors at a deeper level. I'm doing the same with the capture side for safety,
though I've not yet had any reports about that one.
*/
if (frameCount > 0) {
ma_device_handle_backend_data_callback(pDevice, pAudioData, NULL, (ma_uint32)frameCount);
}
(void)pStream;
(void)pStream;
return MA_AAUDIO_CALLBACK_RESULT_CONTINUE;
return MA_AAUDIO_CALLBACK_RESULT_CONTINUE;
...
@@ -42635,6 +42644,15 @@ MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void
...
@@ -42635,6 +42644,15 @@ MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void
return MA_INVALID_ARGS;
return MA_INVALID_ARGS;
}
}
/*
There is an assert deeper in the code that checks that frameCount > 0. Since this is a public facing
API we'll need to check for that here. I've had reports that AAudio can sometimes post a frame count
of 0.
*/
if (frameCount == 0) {
return MA_INVALID_ARGS;
}
if (pDevice->type == ma_device_type_duplex) {
if (pDevice->type == ma_device_type_duplex) {
if (pInput != NULL) {
if (pInput != NULL) {
ma_device__handle_duplex_callback_capture(pDevice, frameCount, pInput, &pDevice->duplexRB.rb);
ma_device__handle_duplex_callback_capture(pDevice, frameCount, pInput, &pDevice->duplexRB.rb);
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