mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
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:
parent
824e33c82b
commit
37fb8d22da
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue