mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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>
This commit is contained in:
parent
9059fb3b4e
commit
063a1d350f
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue