[vlc-commits] PulseAudio: clear all stream callbacks before disconnection
Rémi Denis-Courmont
git at videolan.org
Thu Aug 11 17:00:02 CEST 2011
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 10 22:24:43 2011 +0300| [36ea215ddf20f96ae052c08dc72ff7130285629a] | committer: Rémi Denis-Courmont
PulseAudio: clear all stream callbacks before disconnection
This should fix the infrequent assertions failures at exit.
(cherry picked from commit 2e09a58d867f214a18c964684712842a971d1919)
Conflicts:
modules/audio_output/pulse.c
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=36ea215ddf20f96ae052c08dc72ff7130285629a
---
modules/audio_output/pulse.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 37f5141..f25d80e 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -626,15 +626,17 @@ static void Close (vlc_object_t *obj)
pa_threaded_mainloop_lock(mainloop);
if (s != NULL) {
- pa_operation *op;
-
- op = pa_stream_flush(s, NULL, NULL);
- if (op != NULL)
- pa_operation_unref(op);
- op = pa_stream_drain(s, NULL, NULL);
- if (op != NULL)
- pa_operation_unref(op);
pa_stream_disconnect(s);
+
+ /* Clear all callbacks */
+ pa_stream_set_state_callback(s, NULL, NULL);
+ pa_stream_set_latency_update_callback(s, NULL, aout);
+ pa_stream_set_moved_callback(s, NULL, aout);
+ pa_stream_set_overflow_callback(s, NULL, aout);
+ pa_stream_set_started_callback(s, NULL, aout);
+ pa_stream_set_suspended_callback(s, NULL, aout);
+ pa_stream_set_underflow_callback(s, NULL, aout);
+
pa_stream_unref(s);
}
if (ctx != NULL)
More information about the vlc-commits
mailing list