Fix segfault when s_openal=0 but USE_OPENAL=1

If the game was compiled with openal support (USE_OPENAL is defined),
but it's disabled via cvar (set s_openal 0) there could be segfaults
when calls to openal where done anyway, because the check
if(sound_started == SS_OAL) was forgotten.
This is fixed now.
This commit is contained in:
Daniel Gibson 2012-05-17 14:47:05 +02:00
parent 5bf1ee670d
commit 62d76b3d40
2 changed files with 6 additions and 1 deletions

View file

@ -413,6 +413,9 @@ void AL_Update( void ) {
void AL_Underwater()
{
int i;
if(sound_started != SS_OAL) {
return;
}
// Apply to all sources
for (i = 0; i < s_numchannels; i++)

View file

@ -588,7 +588,9 @@ OGG_Stop ( void )
}
#ifdef USE_OPENAL
AL_UnqueueRawSamples();
if(sound_started == SS_OAL) {
AL_UnqueueRawSamples();
}
#endif
ov_clear( &ovFile );