Index: lib/sound/audio.c =================================================================== --- lib/sound/audio.c (revision 9245) +++ lib/sound/audio.c (working copy) @@ -527,9 +527,9 @@ { return; } - sound_GetError(); // clear error codes + alGetError(); // clear error codes audio_UpdateQueue(); - sound_GetError(); // clear error codes + alGetError(); // clear error codes // get player position playerPos = audio_GetPlayerPos(); audio_Get3DPlayerRotAboutVerticalAxis(&angle); Index: lib/sound/openal_track.c =================================================================== --- lib/sound/openal_track.c (revision 9245) +++ lib/sound/openal_track.c (working copy) @@ -183,7 +183,7 @@ alcMakeContextCurrent(context); - err = sound_GetDeviceError(device); + err = sound_GetContextError(device); if (err != ALC_NO_ERROR) { debug(LOG_ERROR, "Couldn't initialize audio context: %s", alcGetString(device, err)); @@ -253,13 +253,15 @@ /* On Linux since this caused some versions of OpenAL to hang on exit. - Per */ debug(LOG_SOUND, "make default context NULL"); alcMakeContextCurrent(NULL); + sound_GetContextError(device); debug(LOG_SOUND, "destroy previous context"); alcDestroyContext(context); // this gives a long delay on some impl. + sound_GetContextError(device); debug(LOG_SOUND, "close device"); alcCloseDevice(device); - sound_GetError(); + sound_GetContextError(device); #endif while( aSample ) @@ -390,7 +392,7 @@ alcProcessContext(context); - err = sound_GetDeviceError(device); + err = sound_GetContextError(device); if (err != ALC_NO_ERROR) { debug(LOG_ERROR, "Error while processing audio context: %s", alGetString(err)); @@ -954,7 +956,7 @@ assert(stream != NULL); #if !defined(WZ_NOSOUND) - sound_GetError(); // clear error codes + alGetError(); // clear error codes // Tell OpenAL to stop playing on the given source alSourceStop(stream->source); sound_GetError(); @@ -1229,7 +1231,7 @@ debug(LOG_SOUND, "sound_StopSample: sample number (%u) out of range, we probably have run out of available OpenAL sources", psSample->iSample); return; } - sound_GetError(); // clear error codes + alGetError(); // clear error codes // Tell OpenAL to stop playing the given sample alSourceStop(psSample->iSample); sound_GetError(); Index: lib/sound/openal_error.c =================================================================== --- lib/sound/openal_error.c (revision 9245) +++ lib/sound/openal_error.c (working copy) @@ -73,7 +73,7 @@ return error; } -ALenum __sound_GetDeviceError(ALCdevice* device, const char* location_description) +ALenum __sound_GetContextError(ALCdevice* device, const char* location_description) { const char* errorString; ALCenum error = alcGetError(device); Index: lib/sound/openal_error.h =================================================================== --- lib/sound/openal_error.h (revision 9245) +++ lib/sound/openal_error.h (working copy) @@ -38,7 +38,7 @@ #endif extern ALenum __sound_GetError(const char* location_description); -extern ALenum __sound_GetDeviceError(ALCdevice* device, const char* location_description); +extern ALenum __sound_GetContextError(ALCdevice* device, const char* location_description); /** Check whether an error occurred in OpenAL's current sound context. If one * did occur, print an error message and return the error code. @@ -52,12 +52,12 @@ * \param device the OpenAL device (ALCdevice* pointer) to check for errors on * \return the OpenAL error code */ -#define sound_GetDeviceError(device) \ - __sound_GetDeviceError(device, AT_MACRO) +#define sound_GetContextError(device) \ + __sound_GetContextError(device, AT_MACRO) #else // !defined(WZ_NOSOUND) # define sound_GetError(err_code) AL_NO_ERROR -# define sound_GetDeviceError(err_code) ALC_NO_ERROR +# define sound_GetContextError(err_code) ALC_NO_ERROR #endif // !defined(WZ_NOSOUND) #if defined(__cplusplus)