Web: Fix an error where the buffer size is incorrectly calculated.

Public issue https://github.com/mackron/miniaudio/issues/773
This commit is contained in:
David Reid
2023-11-15 10:10:46 +10:00
parent 3b50a854ec
commit f9ce46330c
+4
View File
@@ -39823,6 +39823,10 @@ static ma_uint32 ma_calculate_period_size_in_frames_from_descriptor__webaudio(co
*/ */
ma_uint32 periodSizeInFrames; ma_uint32 periodSizeInFrames;
if (nativeSampleRate == 0) {
nativeSampleRate = MA_DEFAULT_SAMPLE_RATE;
}
if (pDescriptor->periodSizeInFrames == 0) { if (pDescriptor->periodSizeInFrames == 0) {
if (pDescriptor->periodSizeInMilliseconds == 0) { if (pDescriptor->periodSizeInMilliseconds == 0) {
if (performanceProfile == ma_performance_profile_low_latency) { if (performanceProfile == ma_performance_profile_low_latency) {