Merge branch 'fix-bluez-device' into 'master'

bluetooth: Initialize profile with both input and output directions

See merge request pulseaudio/pulseaudio!677
This commit is contained in:
zhaochengyi 2022-09-27 09:45:45 +00:00
commit 9384338e39

View file

@ -1400,13 +1400,18 @@ static int init_profile(struct userdata *u) {
pa_assert(u->transport); pa_assert(u->transport);
if (get_profile_direction (u->profile) & PA_DIRECTION_OUTPUT) /* For a profile with both input and output directions */
if ((get_profile_direction (u->profile) & PA_DIRECTION_OUTPUT) &&
(get_profile_direction (u->profile) & PA_DIRECTION_INPUT)) {
if (add_sink(u) < 0 || add_source(u) < 0)
r = -1;
} else if (get_profile_direction (u->profile) & PA_DIRECTION_OUTPUT) {
if (add_sink(u) < 0) if (add_sink(u) < 0)
r = -1; r = -1;
} else if (get_profile_direction (u->profile) & PA_DIRECTION_INPUT) {
if (get_profile_direction (u->profile) & PA_DIRECTION_INPUT)
if (add_source(u) < 0) if (add_source(u) < 0)
r = -1; r = -1;
}
return r; return r;
} }