From 8949d45c691fa90fbeff9a2b4c190032d0c9f9aa Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 4 Jun 2022 19:47:38 +0300 Subject: [PATCH] bluez5: check decode/encode capability also at registering Endpoints without decode/encode capability are skipped in the object manager, but we should also skip them in the registration calls (even though in practice this doesn't appear to matter). --- spa/plugins/bluez5/bluez5-dbus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 6fd375781..b754bf69c 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -3553,8 +3553,10 @@ static int register_media_application(struct spa_bt_monitor * monitor) if (!is_a2dp_codec_enabled(monitor, codec)) continue; - register_a2dp_endpoint(monitor, codec, A2DP_SOURCE_ENDPOINT); - register_a2dp_endpoint(monitor, codec, A2DP_SINK_ENDPOINT); + if (codec->encode != NULL) + register_a2dp_endpoint(monitor, codec, A2DP_SOURCE_ENDPOINT); + if (codec->decode != NULL) + register_a2dp_endpoint(monitor, codec, A2DP_SINK_ENDPOINT); } return 0;