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).
This commit is contained in:
Pauli Virtanen 2022-06-04 19:47:38 +03:00 committed by Wim Taymans
parent a84412ccb7
commit 8949d45c69

View file

@ -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;