/* * SF_Shutdown */ void SF_Shutdown( bool verbose ) { if( !soundpool ) { return; } SF_StopAllSounds( true, true ); // wake up the mixer SF_Activate( true ); // wait for the queue to be processed S_FinishSoundCmdPipe( s_cmdPipe ); S_ShutdownBuffers(); // shutdown backend S_IssueShutdownCmd( s_cmdPipe, verbose ); // wait for the queue to be processed S_FinishSoundCmdPipe( s_cmdPipe ); // wait for the backend thread to die trap_Thread_Join( s_backThread ); s_backThread = NULL; S_DestroySoundCmdPipe( &s_cmdPipe ); #ifdef ENABLE_PLAY trap_Cmd_RemoveCommand( "play" ); #endif trap_Cmd_RemoveCommand( "music" ); trap_Cmd_RemoveCommand( "stopmusic" ); trap_Cmd_RemoveCommand( "prevmusic" ); trap_Cmd_RemoveCommand( "nextmusic" ); trap_Cmd_RemoveCommand( "pausemusic" ); trap_Cmd_RemoveCommand( "soundlist" ); trap_Cmd_RemoveCommand( "s_devices" ); QAL_Shutdown(); S_MemFreePool( &soundpool ); }
/* * S_Shutdown */ void S_Shutdown( qboolean verbose ) { S_StopStream(); S_StopBackgroundTrack(); #ifdef ENABLE_PLAY trap_Cmd_RemoveCommand( "play" ); #endif trap_Cmd_RemoveCommand( "music" ); trap_Cmd_RemoveCommand( "stopmusic" ); trap_Cmd_RemoveCommand( "prevmusic" ); trap_Cmd_RemoveCommand( "nextmusic" ); trap_Cmd_RemoveCommand( "pausemusic" ); trap_Cmd_RemoveCommand( "soundlist" ); trap_Cmd_RemoveCommand( "s_devices" ); S_ShutdownSources(); S_ShutdownBuffers(); S_ShutdownDecoders( verbose ); if( alContext ) { if( !snd_shutdown_bug ) qalcMakeContextCurrent( NULL ); qalcDestroyContext( alContext ); alContext = NULL; } if( alDevice ) { qalcCloseDevice( alDevice ); alDevice = NULL; } QAL_Shutdown(); S_MemFreePool( &soundpool ); }
void S_FreeSounds() { S_ShutdownBuffers(); S_InitBuffers(); }