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

fix: Fix usage of unitialized functions

This commit is contained in:
Diadlo 2018-01-18 23:10:03 +03:00
parent daaa5518dd
commit 06ae7ead0c
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -318,16 +318,23 @@ void OpenAL2::doOutput()
}
ALdouble latency[2] = {0};
alGetSourcedvSOFT(alProxySource, AL_SEC_OFFSET_LATENCY_SOFT, latency);
if (echoCancelSupported) {
alGetSourcedvSOFT(alProxySource, AL_SEC_OFFSET_LATENCY_SOFT, latency);
}
checkAlError();
ALshort outBuf[AUDIO_FRAME_SAMPLE_COUNT_PER_CHANNEL] = {0};
alcMakeContextCurrent(alProxyContext);
alcRenderSamplesSOFT(alProxyDev, outBuf, AUDIO_FRAME_SAMPLE_COUNT_PER_CHANNEL);
checkAlcError(alProxyDev);
if (echoCancelSupported) {
alcMakeContextCurrent(alProxyContext);
alcRenderSamplesSOFT(alProxyDev, outBuf, AUDIO_FRAME_SAMPLE_COUNT_PER_CHANNEL);
checkAlcError(alProxyDev);
alcMakeContextCurrent(alOutContext);
}
alcMakeContextCurrent(alOutContext);
alBufferData(bufids[0], AL_FORMAT_MONO16, outBuf, AUDIO_FRAME_SAMPLE_COUNT_PER_CHANNEL * 2, AUDIO_SAMPLE_RATE);
alSourceQueueBuffers(alProxySource, 1, bufids);
// initialize echo canceler if supported