Commit 376635fa authored by Ilkka Ollakka's avatar Ilkka Ollakka

pulseaudio: disable pa_stream_drain on close

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.
parent 9de1b1e3
...@@ -342,6 +342,11 @@ static void Close ( vlc_object_t *p_this ) ...@@ -342,6 +342,11 @@ static void Close ( vlc_object_t *p_this )
pa_threaded_mainloop_lock(p_sys->mainloop); pa_threaded_mainloop_lock(p_sys->mainloop);
pa_stream_set_write_callback(p_sys->stream, NULL, NULL); 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))){ if((o = pa_stream_drain(p_sys->stream, success_cb, p_aout))){
while (pa_operation_get_state(o) != PA_OPERATION_DONE) { while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
CHECK_DEAD_GOTO(fail); CHECK_DEAD_GOTO(fail);
...@@ -352,7 +357,7 @@ static void Close ( vlc_object_t *p_this ) ...@@ -352,7 +357,7 @@ static void Close ( vlc_object_t *p_this )
pa_operation_unref(o); pa_operation_unref(o);
} }
#endif
pa_threaded_mainloop_unlock(p_sys->mainloop); pa_threaded_mainloop_unlock(p_sys->mainloop);
} }
uninit(p_aout); uninit(p_aout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment