mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
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 )
|
||||||
|
@ -340,8 +340,8 @@ static void SDLash_ActiveEvent( int gain )
|
|||||||
if( gain )
|
if( 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…
x
Reference in New Issue
Block a user