From 8dbe5f7ad45541a138e35289923aaee8d3c164d3 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Wed, 19 May 2021 13:37:37 +0530 Subject: [PATCH] bluetooth: ldac: Fix missing check for RTP LDAC payloader element While at it, improve the error message to include the name of the element which was not found. Part-of: --- src/modules/bluetooth/a2dp-codec-ldac-gst.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/bluetooth/a2dp-codec-ldac-gst.c b/src/modules/bluetooth/a2dp-codec-ldac-gst.c index 036d3b446..749cfbe14 100644 --- a/src/modules/bluetooth/a2dp-codec-ldac-gst.c +++ b/src/modules/bluetooth/a2dp-codec-ldac-gst.c @@ -41,10 +41,16 @@ static bool can_be_supported(bool for_encoding) { element_factory = gst_element_factory_find("ldacenc"); if (element_factory == NULL) { - pa_log_info("LDAC encoder not found"); + pa_log_info("LDAC encoder element `ldacenc` not found"); return false; } + gst_object_unref(element_factory); + element_factory = gst_element_factory_find("rtpldacpay"); + if (element_factory == NULL) { + pa_log_info("LDAC RTP payloader element `rtpldacpay` not found"); + return false; + } gst_object_unref(element_factory); return true;