Update miniaudio_device.cpp

This commit is contained in:
wheremyfoodat 2024-09-07 16:20:20 +03:00 committed by GitHub
parent be3613d901
commit 98b2d10ea2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,7 +90,7 @@ void MiniAudioDevice::init(Samples& samples, bool safe) {
deviceConfig.dataCallback = [](ma_device* device, void* out, const void* input, ma_uint32 frameCount) {
auto self = reinterpret_cast<MiniAudioDevice*>(device->pUserData);
s16* output = reinterpret_cast<ma_int16*>(out);
usize maxSamples = std::min(self->samples->Capacity(), (usize)(frameCount * channelCount));
const usize maxSamples = std::min(self->samples->Capacity(), usize(frameCount * channelCount));
// Wait until there's enough samples to pop
while (self->samples->size() < maxSamples) {