return true;
}
-static bool profile_good_for_input(pa_card_profile *profile) {
+static bool profile_good_for_input(pa_card_profile *profile, unsigned prio) {
+ pa_source *source;
+ uint32_t idx;
+
pa_assert(profile);
if (!pa_safe_streq(profile->card->active_profile->output_name, profile->output_name))
if (profile->card->active_profile->max_sink_channels != profile->max_sink_channels)
return false;
+ PA_IDXSET_FOREACH(source, profile->card->sources, idx) {
+ if (!source->active_port)
+ continue;
+
+ if ((source->active_port->available != PA_AVAILABLE_NO) && (source->active_port->priority >= prio))
+ return false;
+ }
+
return true;
}
case PA_DIRECTION_INPUT:
name = profile->input_name;
- good = profile_good_for_input(profile);
+ good = profile_good_for_input(profile, port->priority);
break;
}