return true;
}
-static pa_bool_t try_to_switch_profile(pa_device_port *port) {
+static int try_to_switch_profile(pa_device_port *port) {
pa_card_profile *best_profile = NULL, *profile;
void *state;
if (!best_profile) {
pa_log_debug("No suitable profile found");
- return FALSE;
+ return -1;
}
if (pa_card_set_profile(port->card, best_profile->name, FALSE) != 0) {
pa_log_debug("Could not set profile %s", best_profile->name);
- return FALSE;
+ return -1;
}
- return TRUE;
+ return 0;
}
static void find_sink_and_source(pa_card *card, pa_device_port *port, pa_sink **si, pa_source **so)
return PA_HOOK_OK;
if (!is_active_profile) {
- if (!try_to_switch_profile(port))
+ if (try_to_switch_profile(port) < 0)
return PA_HOOK_OK;
pa_assert(card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name));