mirror of https://github.com/FWGS/xash3d-fwgs
engine: platform: fix access to uninitialized audio subsystem when -nosound was passed
This commit is contained in:
parent
3d9a4560d5
commit
c68af64fe5
|
@ -376,6 +376,9 @@ between a deactivate and an activate.
|
|||
*/
|
||||
void SNDDMA_Activate( qboolean active )
|
||||
{
|
||||
if( !dma.initialized )
|
||||
return;
|
||||
|
||||
s_alsa.paused = !active;
|
||||
|
||||
if( !s_alsa.paused )
|
||||
|
|
|
@ -340,8 +340,8 @@ static void SDLash_ActiveEvent( int gain )
|
|||
if( gain )
|
||||
{
|
||||
host.status = HOST_FRAME;
|
||||
IN_ActivateMouse(true);
|
||||
if( snd_mute_losefocus.value )
|
||||
IN_ActivateMouse( true );
|
||||
if( dma.initialized && snd_mute_losefocus.value )
|
||||
{
|
||||
SNDDMA_Activate( true );
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ static void SDLash_ActiveEvent( int gain )
|
|||
#endif
|
||||
host.status = HOST_NOFOCUS;
|
||||
IN_DeactivateMouse();
|
||||
if( snd_mute_losefocus.value )
|
||||
if( dma.initialized && snd_mute_losefocus.value )
|
||||
{
|
||||
SNDDMA_Activate( false );
|
||||
}
|
||||
|
|
|
@ -264,6 +264,9 @@ between a deactivate and an activate.
|
|||
*/
|
||||
void SNDDMA_Activate( qboolean active )
|
||||
{
|
||||
if( !dma.initialized )
|
||||
return;
|
||||
|
||||
SDL_PauseAudioDevice( sdl_dev, !active );
|
||||
}
|
||||
#endif // XASH_SOUND == SOUND_SDL
|
||||
|
|
Loading…
Reference in New Issue