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 )
|
void SNDDMA_Activate( qboolean active )
|
||||||
{
|
{
|
||||||
|
if( !dma.initialized )
|
||||||
|
return;
|
||||||
|
|
||||||
s_alsa.paused = !active;
|
s_alsa.paused = !active;
|
||||||
|
|
||||||
if( !s_alsa.paused )
|
if( !s_alsa.paused )
|
||||||
|
|
|
@ -341,7 +341,7 @@ static void SDLash_ActiveEvent( int gain )
|
||||||
{
|
{
|
||||||
host.status = HOST_FRAME;
|
host.status = HOST_FRAME;
|
||||||
IN_ActivateMouse( true );
|
IN_ActivateMouse( true );
|
||||||
if( snd_mute_losefocus.value )
|
if( dma.initialized && snd_mute_losefocus.value )
|
||||||
{
|
{
|
||||||
SNDDMA_Activate( true );
|
SNDDMA_Activate( true );
|
||||||
}
|
}
|
||||||
|
@ -361,7 +361,7 @@ static void SDLash_ActiveEvent( int gain )
|
||||||
#endif
|
#endif
|
||||||
host.status = HOST_NOFOCUS;
|
host.status = HOST_NOFOCUS;
|
||||||
IN_DeactivateMouse();
|
IN_DeactivateMouse();
|
||||||
if( snd_mute_losefocus.value )
|
if( dma.initialized && snd_mute_losefocus.value )
|
||||||
{
|
{
|
||||||
SNDDMA_Activate( false );
|
SNDDMA_Activate( false );
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,6 +264,9 @@ between a deactivate and an activate.
|
||||||
*/
|
*/
|
||||||
void SNDDMA_Activate( qboolean active )
|
void SNDDMA_Activate( qboolean active )
|
||||||
{
|
{
|
||||||
|
if( !dma.initialized )
|
||||||
|
return;
|
||||||
|
|
||||||
SDL_PauseAudioDevice( sdl_dev, !active );
|
SDL_PauseAudioDevice( sdl_dev, !active );
|
||||||
}
|
}
|
||||||
#endif // XASH_SOUND == SOUND_SDL
|
#endif // XASH_SOUND == SOUND_SDL
|
||||||
|
|
Loading…
Reference in New Issue