From 18a29a7a5e0a50601ef49bddbd6d3bb4d572aa37 Mon Sep 17 00:00:00 2001 From: Dan Glastonbury Date: Tue, 6 Mar 2018 14:54:52 +1000 Subject: pulse: Handle info == NULL in pa_context_get_server_info callbacks. A bit of defensive programming. An ASSERT that info != NULL fires in the rust version of the pulse back end. Adding here for completeness. --- src/cubeb_pulse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c index 1cac5ea..055bc5f 100644 --- a/src/cubeb_pulse.c +++ b/src/cubeb_pulse.c @@ -177,7 +177,15 @@ sink_info_callback(pa_context * context, const pa_sink_info * info, int eol, voi static void server_info_callback(pa_context * context, const pa_server_info * info, void * u) { + cubeb * ctx = u; pa_operation * o; + + if (!info) { + // If info is NULL, the pa_context_get_server_info command timed out. + WRAP(pa_threaded_mainloop_signal)(ctx->mainloop, 0); + return; + } + o = WRAP(pa_context_get_sink_info_by_name)(context, info->default_sink_name, sink_info_callback, u); if (o) { WRAP(pa_operation_unref)(o); -- cgit v1.2.3