Don't open a streamed sfx when there's no sound driver.

This happens when qf fails to connect to jackd (possibly other times).
There is probably a better solution to the problem, but not opening a
stream when the sample rate is reported as 0 definitely fixes the inifinite
recursion in read_samples().
This commit is contained in:
Bill Currie 2010-11-14 20:46:29 +09:00
parent 824e33c82b
commit 37fb8d22da

View file

@ -120,6 +120,11 @@ SND_SFX_StreamOpen (sfx_t *sfx, void *file,
int frames;
int size;
// if the speed is 0, there is no sound driver (probably failed to connect
// to jackd)
if (!snd_shm->speed)
return 0;
sfx_t *new_sfx = calloc (1, sizeof (sfx_t));
new_sfx->name = sfx->name;