diff options
author | Tim Angus <tim@ngus.net> | 2009-10-13 17:17:27 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:49 +0000 |
commit | 6efd4cef3cfcc44d6727cb0e54da26fbb74a7533 (patch) | |
tree | fdb5ee764999ac868d00c54cefb8c290f1735fd6 /src/client/snd_openal.c | |
parent | fafe107646105e680e2bd4a82d9330dffaf69c9a (diff) |
* Merge ioq3-r1666
Diffstat (limited to 'src/client/snd_openal.c')
-rw-r--r-- | src/client/snd_openal.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c index 1f91ae95..be064697 100644 --- a/src/client/snd_openal.c +++ b/src/client/snd_openal.c @@ -99,6 +99,22 @@ static const char *S_AL_ErrorMsg(ALenum error) } } +/* +================= +S_AL_ClearError +================= +*/ +static void S_AL_ClearError( qboolean quiet ) +{ + int error = qalGetError(); + + if( quiet ) + return; + if(error != AL_NO_ERROR) + Com_Printf(S_COLOR_YELLOW "WARNING: unhandled AL error: %s\n", + S_AL_ErrorMsg(error)); +} + //=========================================================================== @@ -219,7 +235,8 @@ static void S_AL_BufferUnload(sfxHandle_t sfx) if(!knownSfx[sfx].inMemory) return; - // Delete it + // Delete it + S_AL_ClearError( qfalse ); qalDeleteBuffers(1, &knownSfx[sfx].buffer); if((error = qalGetError()) != AL_NO_ERROR) Com_Printf( S_COLOR_RED "ERROR: Can't delete sound buffer for %s\n", @@ -303,6 +320,7 @@ static void S_AL_BufferLoad(sfxHandle_t sfx) format = S_AL_Format(info.width, info.channels); // Create a buffer + S_AL_ClearError( qfalse ); qalGenBuffers(1, &knownSfx[sfx].buffer); if((error = qalGetError()) != AL_NO_ERROR) { @@ -636,7 +654,8 @@ qboolean S_AL_SrcInit( void ) limit = MAX_SRC; else if(limit < 16) limit = 16; - + + S_AL_ClearError( qfalse ); // Allocate as many sources as possible for(i = 0; i < limit; i++) { @@ -1559,6 +1578,8 @@ void S_AL_MusicProcess(ALuint b) ALuint format; snd_stream_t *curstream; + S_AL_ClearError( qfalse ); + if(intro_stream) curstream = intro_stream; else @@ -1741,7 +1762,7 @@ static cvar_t *s_alCapture; #elif defined(MACOS_X) #define ALDRIVER_DEFAULT "/System/Library/Frameworks/OpenAL.framework/OpenAL" #else -#define ALDRIVER_DEFAULT "libopenal.so.0" +#define ALDRIVER_DEFAULT "libopenal.so.1" #endif /* |