]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Fix unexpected assert with pulse plugin
authorTakashi Iwai <tiwai@suse.de>
Mon, 29 Oct 2007 10:07:01 +0000 (11:07 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 29 Oct 2007 10:07:01 +0000 (11:07 +0100)
This patch fixes the unexpected assert call at calling snd_pcm_hw_params
in PREPARED state.  Since multiple hw_params calls are allowed, the pulse
plugin shouldn't call assert.

Handled in ALSA bug#3470.

From: Sean McNamara <smcnam@gmail.com>

pulse/pcm_pulse.c

index 96ef6bcdbee4dc6b936613122dab9b219d2545f7..7d8f59e7fffeb06e7a73b8cc01128228b1f8813d 100644 (file)
@@ -490,15 +490,18 @@ finish:
 static int pulse_hw_params(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params)
 {
     snd_pcm_pulse_t *pcm = io->private_data;
+    snd_pcm_t *base = io->pcm;
        int err = 0;
 
     assert(pcm);
     assert(pcm->p);
 
+    //Resolving bugtrack ID 0003470
+    if(!(base && snd_pcm_state(base) == SND_PCM_STATE_PREPARED))
+       assert(!pcm->stream);
+    
     pa_threaded_mainloop_lock(pcm->p->mainloop);
 
-    assert(!pcm->stream);
-
     pcm->frame_size = (snd_pcm_format_physical_width(io->format) * io->channels) / 8;
 
     switch (io->format) {