summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2015-05-05 17:01:12 +0200
committerTanu Kaskinen <tanuk@iki.fi>2015-10-19 17:12:21 +0300
commit470335638640e9515fb56e2fa4ae9117b785c383 (patch)
treeeaa504cb57a650518951948563789b1065cfb0ae
parentd9186d6d34f3a1cb2a85f2ed75755b76d4004b93 (diff)
downloadpulseaudio-470335638640e9515fb56e2fa4ae9117b785c383.tar.gz
module-switch-on-port-available: Use input and output names
In case input or output names are filled in, we can use this to get a better match in the profile_good_for_input/output functions instead of guessing based on number of sources and channels. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r--src/modules/module-switch-on-port-available.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
index eb8f2d7bb..8de68a3ec 100644
--- a/src/modules/module-switch-on-port-available.c
+++ b/src/modules/module-switch-on-port-available.c
@@ -23,6 +23,7 @@
#endif
#include <pulsecore/core.h>
+#include <pulsecore/core-util.h>
#include <pulsecore/device-port.h>
#include <pulsecore/hashmap.h>
@@ -34,6 +35,9 @@ static bool profile_good_for_output(pa_card_profile *profile) {
pa_assert(profile);
+ if (!pa_safe_streq(profile->card->active_profile->input_name, profile->input_name))
+ return false;
+
if (profile->card->active_profile->n_sources != profile->n_sources)
return false;
@@ -55,6 +59,9 @@ static bool profile_good_for_output(pa_card_profile *profile) {
static bool profile_good_for_input(pa_card_profile *profile) {
pa_assert(profile);
+ if (!pa_safe_streq(profile->card->active_profile->output_name, profile->output_name))
+ return false;
+
if (profile->card->active_profile->n_sinks != profile->n_sinks)
return false;