fix the crash on focus loss when using in_snd_block and -nosound

This commit is contained in:
Bill Currie 2002-09-30 03:59:55 +00:00
parent 6a96697080
commit 4a1db5a998

View file

@ -349,14 +349,14 @@ SNDDMA_Submit (void)
static void
SNDDMA_BlockSound (void)
{
if (++snd_blocked == 1)
if (snd_inited && ++snd_blocked == 1)
qfsnd_pcm_pause (pcm, 1);
}
static void
SNDDMA_UnblockSound (void)
{
if (!snd_blocked)
if (!snd_inited || !snd_blocked)
return;
if (!--snd_blocked)
qfsnd_pcm_pause (pcm, 0);