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>
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);