From a68652a42c14e6d2136601d4a34ad1a2e7336e92 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Tue, 14 Aug 2012 17:08:34 +0300 Subject: [PATCH] loopback: Use the real sample spec once it's known. When module-loopback is loaded without arguments, the ss and map variables are initialized with dummy values. This caused a problem, because also pa_memblockq_new() was called with the dummy values, making it work incorrectly. The base was set to 1 instead of the real frame size, which in turn caused alignment related crashes. --- src/modules/module-loopback.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c index 26d2e6a41..d80494a1c 100644 --- a/src/modules/module-loopback.c +++ b/src/modules/module-loopback.c @@ -845,6 +845,11 @@ int pa__init(pa_module *m) { if (!u->sink_input) goto fail; + /* If format, rate or channels were originally unset, they are set now + * after the pa_sink_input_new() call. */ + ss = u->sink_input->sample_spec; + map = u->sink_input->channel_map; + u->sink_input->parent.process_msg = sink_input_process_msg_cb; u->sink_input->pop = sink_input_pop_cb; u->sink_input->process_rewind = sink_input_process_rewind_cb;