pcm direct plugins: drain() call might be blocked when threads are used

Add SETUP state checks and do modifications according latest ALSA driver
(passing wrong event identification).

ALSA bug#4914

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2010-03-03 10:58:53 +01:00
parent 7fd0d9f423
commit b9dbee694a
5 changed files with 20 additions and 14 deletions

View file

@ -355,9 +355,9 @@ static int snd_pcm_dshare_drop(snd_pcm_t *pcm)
snd_pcm_direct_t *dshare = pcm->private_data;
if (dshare->state == SND_PCM_STATE_OPEN)
return -EBADFD;
dshare->state = SND_PCM_STATE_SETUP;
snd_pcm_direct_timer_stop(dshare);
do_silence(pcm);
dshare->state = SND_PCM_STATE_SETUP;
return 0;
}