Skip to content

Commit

Permalink
Fix deadlock when changing codec on debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Aug 7, 2024
1 parent 6131495 commit 1c74af7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ba-transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,16 +687,14 @@ struct ba_transport *ba_transport_new_midi(
* @return Human-readable string. */
const char *ba_transport_debug_name(
const struct ba_transport *t) {
const enum ba_transport_profile profile = t->profile;
const uint32_t codec_id = ba_transport_get_codec(t);
switch (profile) {
switch (t->profile) {
case BA_TRANSPORT_PROFILE_NONE:
return "NONE";
case BA_TRANSPORT_PROFILE_A2DP_SOURCE:
case BA_TRANSPORT_PROFILE_A2DP_SINK:
return t->a2dp.sep->name;
case BA_TRANSPORT_PROFILE_HFP_HF:
switch (codec_id) {
switch (ba_transport_get_codec(t)) {
case HFP_CODEC_UNDEFINED:
return "HFP Hands-Free (...)";
case HFP_CODEC_CVSD:
Expand All @@ -707,7 +705,7 @@ const char *ba_transport_debug_name(
return "HFP Hands-Free (LC3-SWB)";
} break;
case BA_TRANSPORT_PROFILE_HFP_AG:
switch (codec_id) {
switch (ba_transport_get_codec(t)) {
case HFP_CODEC_UNDEFINED:
return "HFP Audio Gateway (...)";
case HFP_CODEC_CVSD:
Expand All @@ -726,7 +724,8 @@ const char *ba_transport_debug_name(
return "MIDI";
#endif
}
debug("Unknown transport: profile:%#x codec:%#x", profile, codec_id);
debug("Unknown transport: profile:%#x codec:%#x",
t->profile, ba_transport_get_codec(t));
return "N/A";
}
#endif
Expand Down

0 comments on commit 1c74af7

Please sign in to comment.