[pulseaudio-commits] src/modules

Arun Raghavan arun at kemper.freedesktop.org
Sun May 6 02:36:09 UTC 2018


 src/modules/module-allow-passthrough.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit f9f9877d18b1553ad4a1fdaa69e634061e3fea05
Author: Arun Raghavan <arun at arunraghavan.net>
Date:   Fri May 4 21:59:23 2018 +0530

    module-allow-passthrough: Don't crash if we can't find a sink
    
    module-allow-passthrough has a (necessary) hack to replicate the default
    sink selection and format negotiation from sink-input.c. One thing that
    got missed in this replication is the possibility that the sink input is
    not compatible with the default sink. When this happen, we now exit
    gracefully.

diff --git a/src/modules/module-allow-passthrough.c b/src/modules/module-allow-passthrough.c
index 16b421d7..f7c61559 100644
--- a/src/modules/module-allow-passthrough.c
+++ b/src/modules/module-allow-passthrough.c
@@ -184,6 +184,12 @@ static pa_hook_result_t sink_input_new_cb(pa_core *core, pa_sink_input_new_data
     if (!new_data->format && new_data->nego_formats && !pa_idxset_isempty(new_data->nego_formats))
         new_data->format = pa_format_info_copy(pa_idxset_first(new_data->nego_formats, NULL));
 
+    if (!new_data->format) {
+        /* Sink doesn't support any requested format */
+        pa_log_debug("Default sink does not match sink input requested formats");
+        return PA_HOOK_OK;
+    }
+
     if (pa_sink_input_new_data_is_passthrough(new_data))
         return new_passthrough_stream(u, core, new_data->sink, NULL);
 



More information about the pulseaudio-commits mailing list