[vlc-commits] Flush PulseAudio stream on overflow (fix #5464)

Rémi Denis-Courmont git at videolan.org
Tue Oct 18 17:55:56 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Oct 18 18:55:16 2011 +0300| [836d970806b986949b9b2f847d16cf73f8bdadca] | committer: Rémi Denis-Courmont

Flush PulseAudio stream on overflow (fix #5464)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=836d970806b986949b9b2f847d16cf73f8bdadca
---

 modules/audio_output/pulse.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 2596194..ecc563c 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -414,9 +414,13 @@ static void stream_moved_cb(pa_stream *s, void *userdata)
 static void stream_overflow_cb(pa_stream *s, void *userdata)
 {
     audio_output_t *aout = userdata;
+    pa_operation *op;
 
-    msg_Err(aout, "overflow");
-    (void) s;
+    msg_Err(aout, "overflow, flushing");
+    op = pa_stream_flush(s, NULL, NULL);
+    if (likely(op != NULL))
+        pa_operation_unref(op);
+    stream_reset_sync(s, aout);
 }
 
 static void stream_started_cb(pa_stream *s, void *userdata)



More information about the vlc-commits mailing list