mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
bluez5: Do not suspend on no -> unknown profile transitions
In case a transport is currently disconnected and transitions to idle, that should not count as a "remote hang up" event. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
6027cb52d9
commit
de1e78a47c
1 changed files with 3 additions and 1 deletions
|
|
@ -1968,11 +1968,13 @@ static void handle_transport_state_change(struct userdata *u, struct pa_bluetoot
|
|||
bool release = false;
|
||||
pa_card_profile *cp;
|
||||
pa_device_port *port;
|
||||
pa_available_t oldavail;
|
||||
|
||||
pa_assert(u);
|
||||
pa_assert(t);
|
||||
pa_assert_se(cp = pa_hashmap_get(u->card->profiles, pa_bluetooth_profile_to_string(t->profile)));
|
||||
|
||||
oldavail = cp->available;
|
||||
pa_card_profile_set_available(cp, transport_state_to_availability(t->state));
|
||||
|
||||
/* Update port availability */
|
||||
|
|
@ -1983,7 +1985,7 @@ static void handle_transport_state_change(struct userdata *u, struct pa_bluetoot
|
|||
|
||||
/* Acquire or release transport as needed */
|
||||
acquire = (t->state == PA_BLUETOOTH_TRANSPORT_STATE_PLAYING && u->profile == t->profile);
|
||||
release = (t->state != PA_BLUETOOTH_TRANSPORT_STATE_PLAYING && u->profile == t->profile);
|
||||
release = (oldavail != PA_AVAILABLE_NO && t->state != PA_BLUETOOTH_TRANSPORT_STATE_PLAYING && u->profile == t->profile);
|
||||
|
||||
if (acquire && transport_acquire(u, true) >= 0) {
|
||||
if (u->source) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue