]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Fix wrong assert in pulse plugin
authorTakashi Iwai <tiwai@suse.de>
Mon, 12 Nov 2007 11:33:31 +0000 (12:33 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 12 Nov 2007 11:33:31 +0000 (12:33 +0100)
assert(!pcm->stream) shouldn't be checked when the PCM state is
SETUP, too (ALSA bug#3470).
The original patch by Mike Gorse <mgorse@mgorse.dhs.org>

pulse/pcm_pulse.c

index 7d8f59e7fffeb06e7a73b8cc01128228b1f8813d..67f97b547e7905d38fd2fb38921700b9a6313f2f 100644 (file)
@@ -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);