Commit c72c363f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

PulseAudio: missing lock

parent b03ea8da
...@@ -823,18 +823,20 @@ static void Close (vlc_object_t *obj) ...@@ -823,18 +823,20 @@ static void Close (vlc_object_t *obj)
var_DelCallback (aout, "audio-device", StreamMove, s); var_DelCallback (aout, "audio-device", StreamMove, s);
var_Destroy (aout, "audio-device"); var_Destroy (aout, "audio-device");
vlc_pa_lock ();
pa_stream_disconnect(s); pa_stream_disconnect(s);
/* Clear all callbacks */ /* Clear all callbacks */
pa_stream_set_state_callback(s, NULL, NULL); pa_stream_set_state_callback(s, NULL, NULL);
pa_stream_set_latency_update_callback(s, NULL, aout); pa_stream_set_latency_update_callback(s, NULL, NULL);
pa_stream_set_moved_callback(s, NULL, aout); pa_stream_set_moved_callback(s, NULL, NULL);
pa_stream_set_overflow_callback(s, NULL, aout); pa_stream_set_overflow_callback(s, NULL, NULL);
pa_stream_set_started_callback(s, NULL, aout); pa_stream_set_started_callback(s, NULL, NULL);
pa_stream_set_suspended_callback(s, NULL, aout); pa_stream_set_suspended_callback(s, NULL, NULL);
pa_stream_set_underflow_callback(s, NULL, aout); pa_stream_set_underflow_callback(s, NULL, NULL);
pa_stream_unref(s); pa_stream_unref(s);
vlc_pa_unlock ();
} }
vlc_pa_disconnect(obj, ctx); vlc_pa_disconnect(obj, ctx);
......
...@@ -262,9 +262,11 @@ void vlc_pa_disconnect (vlc_object_t *obj, pa_context *ctx) ...@@ -262,9 +262,11 @@ void vlc_pa_disconnect (vlc_object_t *obj, pa_context *ctx)
{ {
pa_threaded_mainloop *mainloop = vlc_pa_mainloop; pa_threaded_mainloop *mainloop = vlc_pa_mainloop;
vlc_pa_lock ();
pa_context_disconnect (ctx); pa_context_disconnect (ctx);
pa_context_set_state_callback (ctx, NULL, NULL); pa_context_set_state_callback (ctx, NULL, NULL);
pa_context_unref (ctx); pa_context_unref (ctx);
vlc_pa_unlock ();
vlc_pa_mainloop_deinit (mainloop); vlc_pa_mainloop_deinit (mainloop);
(void) obj; (void) obj;
......
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