summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@digia.com>2012-08-14 14:08:34 (GMT)
committerTanu Kaskinen <tanuk@iki.fi>2012-10-30 14:26:06 (GMT)
commita68652a42c14e6d2136601d4a34ad1a2e7336e92 (patch)
tree81849637ee06080276c78219e6f2742bca7f88ae
parente4adf9c4d8a33509828b9b7658d4cccc7f5af563 (diff)
downloadpulseaudio-a68652a42c14e6d2136601d4a34ad1a2e7336e92.tar.gz
pulseaudio-a68652a42c14e6d2136601d4a34ad1a2e7336e92.tar.xz
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.
-rw-r--r--src/modules/module-loopback.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 26d2e6a..d80494a 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;