pa_sink_input_new() assumes that data->sample_spec is valid.
Submitted by Tanu Kaskinen
Assigned to pul..@..op.org
If the sink input new data has all PA_SINK_INPUT_FIX_* flags set, then pa_sink_input_new() should ignore the sample spec and channel map of the sink input new data. That's not currently the case: at least pa_format_info_from_sample_spec() is called with data->sample_spec as the parameter, and that will crash if the sample spec is not valid.
One part of this problem is that it's not possible to set only one of sample format and sample rate in pa_sink_input_new_data. This is a problem at least with module-loopback: it accepts the "format" and "rate" module arguments, and it's a perfectly reasonable thing for the user to set only one of them. If the user sets only the sample rate, for example, then it should be possible for module-loopback to only set the rate in pa_sink_input_new_data and leave the format unspecified.
There's a FIXME item related to this, search for "FIXME" in this commit diff: http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=c6d8d1d7c19a105b224eac393e44bae319897b6b
(The same issue exists for source outputs too.)