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.
This commit is contained in:
Tanu Kaskinen 2012-08-14 17:08:34 +03:00 committed by Tanu Kaskinen
parent e4adf9c4d8
commit a68652a42c

View file

@ -845,6 +845,11 @@ int pa__init(pa_module *m) {
if (!u->sink_input) if (!u->sink_input)
goto fail; 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->parent.process_msg = sink_input_process_msg_cb;
u->sink_input->pop = sink_input_pop_cb; u->sink_input->pop = sink_input_pop_cb;
u->sink_input->process_rewind = sink_input_process_rewind_cb; u->sink_input->process_rewind = sink_input_process_rewind_cb;