diff options
author | Takayuki 'January June' Suwa <jjsuwa.sys3175@gmail.com> | 2017-05-06 14:42:56 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-07 00:54:26 +0300 |
commit | ea93b74074c509f59942c7ed4112ed3d64c3af33 (patch) | |
tree | 8326d1ff816aa08ffa057fc7a18d018ddb9922cc /libavdevice/alsa.c | |
parent | 8a8335de030aa6cb6356bb16c7d3aefc5a80e362 (diff) |
avdevice/alsa: wait until playback buffers are drained before closing
This fixes early abort on ALSA playback
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavdevice/alsa.c')
-rw-r--r-- | libavdevice/alsa.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |