]> git.sesse.net Git - vlc/commitdiff
Flush PulseAudio stream on overflow (fix #5464)
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 18 Oct 2011 15:55:16 +0000 (18:55 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 18 Oct 2011 15:55:16 +0000 (18:55 +0300)
modules/audio_output/pulse.c

index 2596194bf4620597c8261b3e69f57673d6bcf1e4..ecc563cad93fde3b2e8dc1dbb25ed97770677be8 100644 (file)
@@ -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)