From 37fb8d22da2cb3e963789bd67c446d3c20369774 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 14 Nov 2010 20:46:29 +0900 Subject: [PATCH] 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(). --- libs/audio/renderer/snd_sfx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/audio/renderer/snd_sfx.c b/libs/audio/renderer/snd_sfx.c index 2c93f5870..97d06ceb9 100644 --- a/libs/audio/renderer/snd_sfx.c +++ b/libs/audio/renderer/snd_sfx.c @@ -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;