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
d726e853
Commit
d726e853
authored
Aug 06, 2024
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an error with the engine's node graph processing.
Public issue
https://github.com/mackron/miniaudio/issues/850
parent
efa270af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
miniaudio.h
miniaudio.h
+23
-0
No files found.
miniaudio.h
View file @
d726e853
...
@@ -75374,6 +75374,21 @@ static void ma_engine_data_callback_internal(ma_device* pDevice, void* pFramesOu
...
@@ -75374,6 +75374,21 @@ static void ma_engine_data_callback_internal(ma_device* pDevice, void* pFramesOu
ma_engine_read_pcm_frames(pEngine, pFramesOut, frameCount, NULL);
ma_engine_read_pcm_frames(pEngine, pFramesOut, frameCount, NULL);
}
}
static ma_uint32 ma_device__get_processing_size_in_frames(ma_device* pDevice)
{
/*
The processing size is the period size. The device can have a fixed sized processing size, or
it can be decided by the backend in which case it can be variable.
*/
if (pDevice->playback.intermediaryBufferCap > 0) {
/* Using a fixed sized processing callback. */
return pDevice->playback.intermediaryBufferCap;
} else {
/* Not using a fixed sized processing callback. Need to estimate the processing size based on the backend. */
return pDevice->playback.internalPeriodSizeInFrames;
}
}
#endif
#endif
MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEngine)
MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEngine)
...
@@ -75467,6 +75482,14 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
...
@@ -75467,6 +75482,14 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
if (pEngine->pDevice != NULL) {
if (pEngine->pDevice != NULL) {
engineConfig.channels = pEngine->pDevice->playback.channels;
engineConfig.channels = pEngine->pDevice->playback.channels;
engineConfig.sampleRate = pEngine->pDevice->sampleRate;
engineConfig.sampleRate = pEngine->pDevice->sampleRate;
/*
The processing size used by the engine is determined by engineConfig.periodSizeInFrames. We want
to make this equal to what the device is using for it's period size. If we don't do that, it's
possible that the node graph will split it's processing into multiple passes which can introduce
glitching.
*/
engineConfig.periodSizeInFrames = ma_device__get_processing_size_in_frames(pEngine->pDevice);
}
}
}
}
#endif
#endif
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