Attached patch resolves the issue mentioned within.
>From 10800493523b9274e7cc8784b65cc183a94b7281 Mon Sep 17 00:00:00 2001 From: Takayuki 'January June' Suwa <jjs...@sys3175.com> Date: Thu, 18 Apr 2019 10:56:40 +0900 Subject: [PATCH] avdevice/alsa: fix indefinite stop on closing PCM capture
Sorry, I forgot to take recording into account... Fixes: https://bugs.archlinux.org/task/58619 Found-by: Elias (Bleuzen) https://bugs.archlinux.org/user/26956 --- libavdevice/alsa.c | 6 ++++-- 1 file 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); -- 2.11.0
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".