[FFmpeg-cvslog] avdevice/alsa: wait until playback buffers are drained before closing

Takayuki 'January June' Suwa git at videolan.org
Sun May 7 02:03:51 EEST 2017


ffmpeg | branch: master | Takayuki 'January June' Suwa <jjsuwa.sys3175 at gmail.com> | Sat May  6 20:42:56 2017 +0900| [ea93b74074c509f59942c7ed4112ed3d64c3af33] | committer: Michael Niedermayer

avdevice/alsa: wait until playback buffers are drained before closing

This fixes early abort on ALSA playback

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea93b74074c509f59942c7ed4112ed3d64c3af33
---

 libavdevice/alsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavdevice/alsa.c b/libavdevice/alsa.c
index 8d27913a1a..1bbff30d5c 100644
--- a/libavdevice/alsa.c
+++ b/libavdevice/alsa.c
@@ -300,6 +300,8 @@ av_cold int ff_alsa_close(AVFormatContext *s1)
 {
     AlsaData *s = s1->priv_data;
 
+    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);



More information about the ffmpeg-cvslog mailing list