]> git.sesse.net Git - vlc/commitdiff
pulseaudio: disable pa_stream_drain on close
authorIlkka Ollakka <ileoo@videolan.org>
Sat, 13 Feb 2010 14:50:14 +0000 (16:50 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sat, 13 Feb 2010 14:51:46 +0000 (16:51 +0200)
I didn't find any reason to do it, and it slows closing quite a lot,
if you know why we should do that, please speak up etc.

modules/audio_output/pulse.c

index 019519249619d0bfdc6a0d3d9b213828210e2310..8ef3e4cccfbffa824373714f3a1210be506336c4 100644 (file)
@@ -342,6 +342,11 @@ static void Close ( vlc_object_t *p_this )
         pa_threaded_mainloop_lock(p_sys->mainloop);
         pa_stream_set_write_callback(p_sys->stream, NULL, NULL);
 
+/* I didn't find any explanation why we need to do pa_stream_drain on close
+ * as we don't really care if we lose 20ms buffer in this point anyway?
+ * And disabling this speeds up closing pulseaudio quite a lot (atleast for me).
+ */
+#if 0
         if((o = pa_stream_drain(p_sys->stream, success_cb, p_aout))){
             while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
                 CHECK_DEAD_GOTO(fail);
@@ -352,7 +357,7 @@ static void Close ( vlc_object_t *p_this )
 
             pa_operation_unref(o);
         }
-
+#endif
         pa_threaded_mainloop_unlock(p_sys->mainloop);
     }
     uninit(p_aout);