Browse Source

avdevice/alsa: fix indefinite stop on closing PCM capture

Fixes: https://bugs.archlinux.org/task/58619

Found-by: Elias (Bleuzen) https://bugs.archlinux.org/user/26956
Signed-off-by: Nicolas George <george@nsup.org>
tags/n4.2
Takayuki 'January June' Suwa Lou Logan 6 years ago
parent
commit
f9a061a31c
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      libavdevice/alsa.c

+ 4
- 2
libavdevice/alsa.c View File

@@ -300,8 +300,10 @@ av_cold int ff_alsa_close(AVFormatContext *s1)
{
AlsaData *s = s1->priv_data;

snd_pcm_nonblock(s->h, 0);
snd_pcm_drain(s->h);
if (snd_pcm_stream(s->h) == SND_PCM_STREAM_PLAYBACK) {
snd_pcm_nonblock(s->h, 0);
snd_pcm_drain(s->h);
}
av_freep(&s->reorder_buf);
if (CONFIG_ALSA_INDEV)
ff_timefilter_destroy(s->timefilter);


Loading…
Cancel
Save