if (!(sink_input = pa_idxset_get_by_index(c->sink_inputs, idx)))
return;
+ /* Ignore this sink input if it is connecting a filter sink to
+ * the master */
+ if (sink_input->origin_sink)
+ return;
+
if (!(name = pa_proplist_get_stream_group(sink_input->proplist, "sink-input", IDENTIFICATION_PROPERTY)))
return;
if (!(source_output = pa_idxset_get_by_index(c->source_outputs, idx)))
return;
+ /* Ignore this source output if it is connecting a filter source to
+ * the master */
+ if (source_output->destination_source)
+ return;
+
if (!(name = pa_proplist_get_stream_group(source_output->proplist, "source-output", IDENTIFICATION_PROPERTY)))
return;
if (new_data->sink)
pa_log_debug("Not restoring device for stream %s, because already set to '%s'.", name, new_data->sink->name);
+ else if (new_data->origin_sink)
+ pa_log_debug("Not restoring device for stream %s, because it connects a filter to the master sink.", name);
else if ((e = entry_read(u, name))) {
pa_sink *s = NULL;
if (!(name = pa_proplist_get_stream_group(new_data->proplist, "sink-input", IDENTIFICATION_PROPERTY)))
return PA_HOOK_OK;
+ if (new_data->origin_sink) {
+ pa_log_debug("Not restoring volume for sink input %s, because it connects a filter to the master sink.", name);
+ return PA_HOOK_OK;
+ }
+
if ((e = entry_read(u, name))) {
if (u->restore_volume && e->volume_valid) {
if (new_data->source)
pa_log_debug("Not restoring device for stream %s, because already set", name);
+ else if (new_data->destination_source)
+ pa_log_debug("Not restoring device for stream %s, because it connects a filter to the master source.", name);
else if ((e = entry_read(u, name))) {
pa_source *s = NULL;
if (!(name = pa_proplist_get_stream_group(new_data->proplist, "source-output", IDENTIFICATION_PROPERTY)))
return PA_HOOK_OK;
+ if (new_data->destination_source) {
+ pa_log_debug("Not restoring volume for source output %s, because it connects a filter to the master source.", name);
+ return PA_HOOK_OK;
+ }
+
if ((e = entry_read(u, name))) {
if (u->restore_volume && e->volume_valid) {
if (!si->sink)
continue;
+ /* Skip this sink input if it is connecting a filter sink to
+ * the master */
+ if (si->origin_sink)
+ continue;
+
/* It might happen that a stream and a sink are set up at the
same time, in which case we want to make sure we don't
interfere with that */
if (!so->source)
continue;
+ /* Skip this source output if it is connecting a filter source to
+ * the master */
+ if (so->destination_source)
+ continue;
+
/* It might happen that a stream and a source are set up at the
same time, in which case we want to make sure we don't
interfere with that */
if (!si->sink)
continue;
+ /* Skip this sink input if it is connecting a filter sink to
+ * the master */
+ if (si->origin_sink)
+ continue;
+
if (!(name = pa_proplist_get_stream_group(si->proplist, "sink-input", IDENTIFICATION_PROPERTY)))
continue;
if (!so->source)
continue;
+ /* Skip this source output if it is connecting a filter source to
+ * the master */
+ if (so->destination_source)
+ continue;
+
if (!(name = pa_proplist_get_stream_group(so->proplist, "source-output", IDENTIFICATION_PROPERTY)))
continue;