Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakayuki 'January June' Suwa <jjsuwa@sys3175.com>2019-04-18 04:56:40 +0300
committerLou Logan <lou@lrcd.com>2019-04-24 01:01:23 +0300
commitf9a061a31c3d2d81b3ec1e1b9b37187a358cdd9e (patch)
tree508d6cb7496bc9f1ff4447e342cf607da478455c /libavdevice/alsa.c
parent22c820f509043afb73682ff4bc82ef006af2a74a (diff)
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>
Diffstat (limited to 'libavdevice/alsa.c')
-rw-r--r--libavdevice/alsa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavdevice/alsa.c b/libavdevice/alsa.c
index 1b21beb6d5..117b2ea144 100644
--- a/libavdevice/alsa.c
+++ b/libavdevice/alsa.c
@@ -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);