1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix: silence warning by not using dynamic arrays on stack

This commit is contained in:
sudden6 2017-03-19 14:13:48 +01:00
parent 7e0bcf089f
commit 300ac12e3f
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -487,10 +487,11 @@ void Audio::playAudioBuffer(ALuint alSource, const int16_t* data, int samples, u
alSourcei(alSource, AL_LOOPING, AL_FALSE); alSourcei(alSource, AL_LOOPING, AL_FALSE);
if (processed) { if (processed) {
ALuint bufids[processed]; ALuint* bufids = new ALuint[processed];
alSourceUnqueueBuffers(alSource, processed, bufids); alSourceUnqueueBuffers(alSource, processed, bufids);
alDeleteBuffers(processed - 1, bufids + 1); alDeleteBuffers(processed - 1, bufids + 1);
bufid = bufids[0]; bufid = bufids[0];
delete[] bufids;
} else if (queued < 16) { } else if (queued < 16) {
alGenBuffers(1, &bufid); alGenBuffers(1, &bufid);
} else { } else {