aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluealsa/hal-bluealsa-transports.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/lib/bluealsa/hal-bluealsa-transports.c')
-rw-r--r--plugins/lib/bluealsa/hal-bluealsa-transports.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/lib/bluealsa/hal-bluealsa-transports.c b/plugins/lib/bluealsa/hal-bluealsa-transports.c
index 56e1a29..590ab5d 100644
--- a/plugins/lib/bluealsa/hal-bluealsa-transports.c
+++ b/plugins/lib/bluealsa/hal-bluealsa-transports.c
@@ -74,6 +74,7 @@ bool halBlueAlsaTransportFind(
}
+
int halBlueAlsaTransportUpdate(
const bluealsa_watch * watch,
bluealsa_transport_t * list,
@@ -129,7 +130,8 @@ static bool halBlueAlsaTransportMatch(const struct ba_msg_transport * transport1
if (transport1->type != transport2->type)
goto done;
- if (transport1->stream != transport2->stream)
+ /* with HFP/ofono, a NULL codec means a hangup. So we consider that the transport has disappeared in that case */
+ if (transport1->codec != transport2->codec)
goto done;
if (bacmp(&transport1->addr, &transport2->addr) != 0) {
@@ -146,8 +148,8 @@ char * halBlueAlsaTransportAsString(char * buff, size_t len, const struct ba_msg
ba2str(&transport->addr, addr);
snprintf(buff, len, "%s,%s,%s", addr,
- transport->type == BA_PCM_TYPE_A2DP?"a2dp":"sco",
- transport->stream == BA_PCM_STREAM_PLAYBACK?"playback":"capture");
+ transport->type & BA_PCM_TYPE_A2DP?"a2dp":"sco",
+ transport->type & BA_PCM_STREAM_PLAYBACK?"playback":"capture");
return buff;
}