[FFmpeg-devel] alsa: reduce of finalization time

Submitted by Евгений on Nov. 16, 2018, 4:44 p.m.

Details

Message ID a1533048-1332-cd19-9d05-6b424cb9046d@obninsk.ru
State New
Headers show

Commit Message

Евгений Nov. 16, 2018, 4:44 p.m.

Comments

Carl Eugen Hoyos Nov. 16, 2018, 9:47 p.m.
2018-11-16 17:44 GMT+01:00, Евгений <kea@obninsk.ru>:

How can I reproduce the issue you see / what behaviour
exactly gets fixed? I find "do not wait for playing buffered
data" not very convincing...

Drop the tabs and please do not add an out-commented
line, replace the line.

Carl Eugen

Patch hide | download patch | download mbox

From b3dbd651718bccd295bbe822bb4614e6afbf0a44 Mon Sep 17 00:00:00 2001
From: Evgeny <kea@obninsk.ru>
Date: Fri, 16 Nov 2018 16:33:21 +0300
Subject: [PATCH 6/6] ALSA out: finalization time is too long not need wait for
 playing buffered data

---
 libavdevice/alsa.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavdevice/alsa.c b/libavdevice/alsa.c
index 1b21beb..b51783b 100644
--- a/libavdevice/alsa.c
+++ b/libavdevice/alsa.c
@@ -301,8 +301,9 @@  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);
+//    snd_pcm_drain(s->h);
+	snd_pcm_drop(s->h);
+	av_freep(&s->reorder_buf);
     if (CONFIG_ALSA_INDEV)
         ff_timefilter_destroy(s->timefilter);
     snd_pcm_close(s->h);
-- 
2.1.4