virtual-surround-sink: Use correct sample spec with memblockq
authorTanu Kaskinen <tanuk@iki.fi>
Sun, 5 Jan 2020 07:31:07 +0000 (09:31 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Sun, 5 Jan 2020 07:31:07 +0000 (09:31 +0200)
The memblockq stores data in the virtual sink format, not in the master
sink format. The wrong sample spec caused a crash when the virtual sink
rendered data whose length was not divisible by the sink input frame
size.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/786

src/modules/module-virtual-surround-sink.c

index d8e0fd9..c321073 100644 (file)
@@ -786,7 +786,7 @@ int pa__init(pa_module*m) {
     u->sink->input_to_master = u->sink_input;
 
     pa_sink_input_get_silence(u->sink_input, &silence);
-    u->memblockq = pa_memblockq_new("module-virtual-surround-sink memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0, &sink_input_ss, 1, 1, 0, &silence);
+    u->memblockq = pa_memblockq_new("module-virtual-surround-sink memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, &silence);
     pa_memblock_unref(silence.memblock);
 
     /* resample hrir */