mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fixes OpenAL errors
This commit is contained in:
parent
74ff3b920e
commit
ae13be0c37
1 changed files with 7 additions and 5 deletions
|
@ -2827,7 +2827,7 @@ openal_channel::set_sfx
|
||||||
*/
|
*/
|
||||||
bool openal_channel::set_sfx(sfx_t *pSfx)
|
bool openal_channel::set_sfx(sfx_t *pSfx)
|
||||||
{
|
{
|
||||||
ALfloat freq = 0;
|
ALint freq = 0;
|
||||||
|
|
||||||
this->pSfx = pSfx;
|
this->pSfx = pSfx;
|
||||||
if (!pSfx->buffer || !qalIsBuffer(pSfx->buffer)) {
|
if (!pSfx->buffer || !qalIsBuffer(pSfx->buffer)) {
|
||||||
|
@ -2893,7 +2893,7 @@ bool openal_channel::set_sfx(sfx_t *pSfx)
|
||||||
alDieIfError();
|
alDieIfError();
|
||||||
|
|
||||||
// Get the base frequency
|
// Get the base frequency
|
||||||
qalGetBufferfv(pSfx->buffer, AL_FREQUENCY, &freq);
|
qalGetBufferi(pSfx->buffer, AL_FREQUENCY, &freq);
|
||||||
alDieIfError();
|
alDieIfError();
|
||||||
|
|
||||||
iBaseRate = freq;
|
iBaseRate = freq;
|
||||||
|
@ -3062,9 +3062,11 @@ void openal_channel::set_sample_loop_count(S32 count)
|
||||||
alDieIfError();
|
alDieIfError();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (S32 i = 0; i < count; i++) {
|
if (buffer) {
|
||||||
qalSourceQueueBuffers(source, 1, &buffer);
|
for (S32 i = 0; i < count; i++) {
|
||||||
alDieIfError();
|
qalSourceQueueBuffers(source, 1, &buffer);
|
||||||
|
alDieIfError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue