Skip to content

Commit

Permalink
bap: Fix MediaEndpoint prop codec for bcast src endpoint
Browse files Browse the repository at this point in the history
Fix MediaEndpoint prop codec returns 0 for bcast src endpoint
  • Loading branch information
silviubarbulescu authored and Vudentz committed Mar 28, 2024
1 parent 07d4272 commit 0ff7392
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion profiles/audio/bap.c
Expand Up @@ -277,7 +277,13 @@ static gboolean get_codec(const GDBusPropertyTable *property,
struct bap_ep *ep = data;
uint8_t codec;

bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL);
/* For broadcast source, rpac is null so the codec
* is retrieved from the lpac
*/
if (ep->rpac == NULL)
bt_bap_pac_get_codec(ep->lpac, &codec, NULL, NULL);
else
bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL);

dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &codec);

Expand Down

0 comments on commit 0ff7392

Please sign in to comment.