From c1027970c49988368a46d887dc7f608d53b14d90 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 12 Nov 2007 12:33:31 +0100 Subject: Fix wrong assert in pulse plugin assert(!pcm->stream) shouldn't be checked when the PCM state is SETUP, too (ALSA bug#3470). The original patch by Mike Gorse --- pulse/pcm_pulse.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pulse') diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c index 7d8f59e..67f97b5 100644 --- a/pulse/pcm_pulse.c +++ b/pulse/pcm_pulse.c @@ -497,8 +497,16 @@ static int pulse_hw_params(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params) assert(pcm->p); //Resolving bugtrack ID 0003470 - if(!(base && snd_pcm_state(base) == SND_PCM_STATE_PREPARED)) - assert(!pcm->stream); + if (!base) { + switch (snd_pcm_state(base)) { + case SND_PCM_STATE_SETUP: + case SND_PCM_STATE_PREPARED: + break; + default: + assert(!pcm->stream); + break; + } + } pa_threaded_mainloop_lock(pcm->p->mainloop); -- cgit