mirror of
https://github.com/mackron/miniaudio.git
synced 2026-07-22 12:52:43 +02:00
Fix a bug where the end of a sound is cutoff.
Public issue https://github.com/mackron/miniaudio/issues/1125
This commit is contained in:
@@ -77123,6 +77123,15 @@ static void ma_engine_node_process_pcm_frames__sound(ma_node* pNode, const float
|
||||
}
|
||||
|
||||
framesJustRead = totalFramesConverted;
|
||||
|
||||
/*
|
||||
When the last iteration of the loop above returns MA_AT_END, we can be in a situation where `result` is MA_AT_END and
|
||||
framesJustRead is >0. This is never valid in miniaudio so we need to normalize this (MA_AT_END should only be used
|
||||
when the number of frames read is exactly 0, everywhere in miniaudio).
|
||||
*/
|
||||
if (result == MA_AT_END && framesJustRead > 0) {
|
||||
result = MA_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
MA_ASSERT(framesJustRead <= pSound->processingCacheCap);
|
||||
|
||||
Reference in New Issue
Block a user