sink: Introduce structure needed to consolidate virtual sink code

This patch introduces the vsink structure which holds all data needed
by virtual sinks. This is in preparation of the consolidation of the
virtual sink code. The input_to_master field of the sink will be moved
to the vsink structure after the consolidation. Until all virtual sinks
are converted, sink->input_to_master and sink->vsink->input_to_master
must both be supported.
This commit is contained in:
Georg Chini 2021-01-01 15:54:26 +01:00
parent ed3d4f0837
commit d18756fda9
4 changed files with 124 additions and 11 deletions

View file

@ -293,7 +293,10 @@ static bool find_paired_master(struct userdata *u, struct filter *filter, pa_obj
if (pa_streq(module_name, si->sink->module->name)) {
/* Make sure we're not routing to another instance of
* the same filter. */
filter->sink_master = si->sink->input_to_master->sink;
if (si->sink->vsink)
filter->sink_master = si->sink->vsink->input_to_master->sink;
else
filter->sink_master = si->sink->input_to_master->sink;
} else {
filter->sink_master = si->sink;
}
@ -461,7 +464,10 @@ static void find_filters_for_module(struct userdata *u, pa_module *m, const char
if (sink->module == m) {
pa_assert(pa_sink_is_filter(sink));
fltr = filter_new(name, parameters, sink->input_to_master->sink, NULL);
if (sink->vsink)
fltr = filter_new(name, parameters, sink->vsink->input_to_master->sink, NULL);
else
fltr = filter_new(name, parameters, sink->input_to_master->sink, NULL);
fltr->module_index = m->index;
fltr->sink = sink;