[vlc-commits] PulseAudio: don't assert at exit if PulseAudio died

Rémi Denis-Courmont git at videolan.org
Thu Mar 31 21:15:48 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar 31 22:15:25 2011 +0300| [0afba62b5d50b496eb9e1d25650c4bd03a7ec94e] | committer: Rémi Denis-Courmont

PulseAudio: don't assert at exit if PulseAudio died

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

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

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index e262bf0..94f1c02 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -340,14 +340,18 @@ static void Close (vlc_object_t *obj)
         pa_stream_set_write_callback(sys->stream, NULL, NULL);
 
         o = pa_stream_flush(sys->stream, success_cb, sys);
-        while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
-            pa_threaded_mainloop_wait(sys->mainloop);
-        pa_operation_unref(o);
+        if (o != NULL) {
+            while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
+                pa_threaded_mainloop_wait(sys->mainloop);
+            pa_operation_unref(o);
+        }
 
         o = pa_stream_drain(sys->stream, success_cb, sys);
-        while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
-            pa_threaded_mainloop_wait(sys->mainloop);
-        pa_operation_unref(o);
+        if (o != NULL) {
+            while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
+                pa_threaded_mainloop_wait(sys->mainloop);
+            pa_operation_unref(o);
+        }
 
         pa_threaded_mainloop_unlock(sys->mainloop);
     }



More information about the vlc-commits mailing list