PA_IDXSET_FOREACH(i, s->inputs, idx) {
compute_reference_ratio(i);
- if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER))
+ if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER)
+ && PA_SINK_IS_LINKED(i->origin_sink->state))
compute_reference_ratios(i->origin_sink);
}
}
pa_cvolume_reset(&i->real_ratio, i->real_ratio.channels);
i->soft_volume = i->volume_factor;
- compute_real_ratios(i->origin_sink);
+ if (PA_SINK_IS_LINKED(i->origin_sink->state))
+ compute_real_ratios(i->origin_sink);
continue;
}
pa_cvolume remapped;
if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER)) {
- get_maximum_input_volume(i->origin_sink, max_volume, channel_map);
+ if (PA_SINK_IS_LINKED(i->origin_sink->state))
+ get_maximum_input_volume(i->origin_sink, max_volume, channel_map);
/* Ignore this input. The origin sink uses volume sharing, so this
* input's volume will be set to be equal to the root sink's real
compute_reference_ratio(i);
}
- update_real_volume(i->origin_sink, new_volume, channel_map);
+ if (PA_SINK_IS_LINKED(i->origin_sink->state))
+ update_real_volume(i->origin_sink, new_volume, channel_map);
}
}
}
pa_cvolume new_volume;
if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER)) {
- propagate_reference_volume(i->origin_sink);
+ if (PA_SINK_IS_LINKED(i->origin_sink->state))
+ propagate_reference_volume(i->origin_sink);
/* Since the origin sink uses volume sharing, this input's volume
* needs to be updated to match the root sink's real volume, but
return false;
PA_IDXSET_FOREACH(i, s->inputs, idx) {
- if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER))
+ if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER)
+ && PA_SINK_IS_LINKED(i->origin_sink->state))
update_reference_volume(i->origin_sink, v, channel_map, false);
}
pa_sw_cvolume_multiply(&new_volume, &new_volume, &i->reference_ratio);
pa_sink_input_set_volume_direct(i, &new_volume);
- if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER))
+ if (i->origin_sink && (i->origin_sink->flags & PA_SINK_SHARE_VOLUME_WITH_MASTER)
+ && PA_SINK_IS_LINKED(i->origin_sink->state))
propagate_real_volume(i->origin_sink, old_real_volume);
}
}
PA_IDXSET_FOREACH(o, s->outputs, idx) {
compute_reference_ratio(o);
- if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER))
+ if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER)
+ && PA_SOURCE_IS_LINKED(o->destination_source->state))
compute_reference_ratios(o->destination_source);
}
}
pa_cvolume_reset(&o->real_ratio, o->real_ratio.channels);
o->soft_volume = o->volume_factor;
- compute_real_ratios(o->destination_source);
+ if (PA_SOURCE_IS_LINKED(o->destination_source->state))
+ compute_real_ratios(o->destination_source);
continue;
}
pa_cvolume remapped;
if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER)) {
- get_maximum_output_volume(o->destination_source, max_volume, channel_map);
+ if (PA_SOURCE_IS_LINKED(o->destination_source->state))
+ get_maximum_output_volume(o->destination_source, max_volume, channel_map);
/* Ignore this output. The origin source uses volume sharing, so this
* output's volume will be set to be equal to the root source's real
compute_reference_ratio(o);
}
- update_real_volume(o->destination_source, new_volume, channel_map);
+ if (PA_SOURCE_IS_LINKED(o->destination_source->state))
+ update_real_volume(o->destination_source, new_volume, channel_map);
}
}
}
pa_cvolume new_volume;
if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER)) {
- propagate_reference_volume(o->destination_source);
+ if (PA_SOURCE_IS_LINKED(o->destination_source->state))
+ propagate_reference_volume(o->destination_source);
/* Since the origin source uses volume sharing, this output's volume
* needs to be updated to match the root source's real volume, but
return false;
PA_IDXSET_FOREACH(o, s->outputs, idx) {
- if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER))
+ if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER)
+ && PA_SOURCE_IS_LINKED(o->destination_source->state))
update_reference_volume(o->destination_source, v, channel_map, false);
}
pa_sw_cvolume_multiply(&new_volume, &new_volume, &o->reference_ratio);
pa_source_output_set_volume_direct(o, &new_volume);
- if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER))
+ if (o->destination_source && (o->destination_source->flags & PA_SOURCE_SHARE_VOLUME_WITH_MASTER)
+ && PA_SOURCE_IS_LINKED(o->destination_source->state))
propagate_real_volume(o->destination_source, old_real_volume);
}
}