summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2013-03-27 16:06:04 +0200
committerTanu Kaskinen <tanuk@iki.fi>2013-03-28 13:21:46 +0200
commit78aa107c3dcfc19bd015b16016f18e6db0bde45a (patch)
tree3dfebe7d1639e5567b67b1323d7d9d95fc86006c
parentcef2bae2c52b6843b92232207947939c393a07d6 (diff)
switch-on-port-available: Fix error reporting style
-rw-r--r--src/modules/module-switch-on-port-available.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
index c4f0b445..d77dcd98 100644
--- a/src/modules/module-switch-on-port-available.c
+++ b/src/modules/module-switch-on-port-available.c
@@ -85,7 +85,7 @@ static bool profile_good_for_input(pa_card_profile *profile) {
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;
@@ -117,15 +117,15 @@ static pa_bool_t try_to_switch_profile(pa_device_port *port) {
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)
@@ -182,7 +182,7 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port
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));