mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-28 05:40:23 -04:00
pcm: close - deactivate async handler before snd_pcm_drop()
It reduces probablity to activate the async handler when snd_pcm_close() is called. Link: https://github.com/alsa-project/alsa-lib/issues/394 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
513ef7ace4
commit
93d7645d84
1 changed files with 4 additions and 4 deletions
|
|
@ -777,6 +777,10 @@ int snd_pcm_close(snd_pcm_t *pcm)
|
|||
{
|
||||
int res = 0, err;
|
||||
assert(pcm);
|
||||
while (!list_empty(&pcm->async_handlers)) {
|
||||
snd_async_handler_t *h = list_entry(pcm->async_handlers.next, snd_async_handler_t, hlist);
|
||||
snd_async_del_handler(h);
|
||||
}
|
||||
if (pcm->setup && !pcm->donot_close) {
|
||||
snd_pcm_drop(pcm);
|
||||
err = snd_pcm_hw_free(pcm);
|
||||
|
|
@ -785,10 +789,6 @@ int snd_pcm_close(snd_pcm_t *pcm)
|
|||
}
|
||||
if (pcm->mmap_channels)
|
||||
snd_pcm_munmap(pcm);
|
||||
while (!list_empty(&pcm->async_handlers)) {
|
||||
snd_async_handler_t *h = list_entry(pcm->async_handlers.next, snd_async_handler_t, hlist);
|
||||
snd_async_del_handler(h);
|
||||
}
|
||||
if (pcm->ops->close)
|
||||
err = pcm->ops->close(pcm->op_arg);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue