From: Marijn Suijten Date: Thu, 21 Jan 2021 11:04:23 +0000 (+0100) Subject: bluetooth/gst: Add assertions around element_add_pad and bin_add X-Git-Tag: v14.99.1~142 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db73004a3ab415ee880c6fb074c764cda05fd8d8;p=platform%2Fupstream%2Fpulseaudio.git bluetooth/gst: Add assertions around element_add_pad and bin_add Part-of: --- diff --git a/src/modules/bluetooth/a2dp-codec-aptx-gst.c b/src/modules/bluetooth/a2dp-codec-aptx-gst.c index f949115..cdf92f7 100644 --- a/src/modules/bluetooth/a2dp-codec-aptx-gst.c +++ b/src/modules/bluetooth/a2dp-codec-aptx-gst.c @@ -362,14 +362,14 @@ bool gst_init_aptx(struct gst_info *info, pa_sample_spec *ss, bool for_encoding) info->enc_bin = gst_bin_new("aptx_enc_bin"); pa_assert(info->enc_bin); - gst_bin_add(GST_BIN(info->enc_bin), enc); + pa_assert_se(gst_bin_add(GST_BIN(info->enc_bin), enc)); pad = gst_element_get_static_pad(enc, "sink"); - gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("sink", pad)); + pa_assert_se(gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("sink", pad))); gst_object_unref(GST_OBJECT(pad)); pad = gst_element_get_static_pad(enc, "src"); - gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("src", pad)); + pa_assert_se(gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("src", pad))); gst_object_unref(GST_OBJECT(pad)); } else { dec = gst_element_factory_make("openaptxdec", "aptx_decoder"); @@ -398,14 +398,14 @@ bool gst_init_aptx(struct gst_info *info, pa_sample_spec *ss, bool for_encoding) info->dec_bin = gst_bin_new("aptx_dec_bin"); pa_assert(info->dec_bin); - gst_bin_add(GST_BIN(info->dec_bin), dec); + pa_assert_se(gst_bin_add(GST_BIN(info->dec_bin), dec)); pad = gst_element_get_static_pad(dec, "sink"); - gst_element_add_pad(info->dec_bin, gst_ghost_pad_new("sink", pad)); + pa_assert_se(gst_element_add_pad(info->dec_bin, gst_ghost_pad_new("sink", pad))); gst_object_unref(GST_OBJECT(pad)); pad = gst_element_get_static_pad(dec, "src"); - gst_element_add_pad(info->dec_bin, gst_ghost_pad_new("src", pad)); + pa_assert_se(gst_element_add_pad(info->dec_bin, gst_ghost_pad_new("src", pad))); gst_object_unref(GST_OBJECT(pad)); } diff --git a/src/modules/bluetooth/a2dp-codec-ldac-gst.c b/src/modules/bluetooth/a2dp-codec-ldac-gst.c index 313ff5b..45fe0f0 100644 --- a/src/modules/bluetooth/a2dp-codec-ldac-gst.c +++ b/src/modules/bluetooth/a2dp-codec-ldac-gst.c @@ -291,11 +291,11 @@ bool gst_init_ldac(struct gst_info *info, pa_sample_spec *ss, bool for_encoding) } pad = gst_element_get_static_pad(enc, "sink"); - gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("sink", pad)); + pa_assert_se(gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("sink", pad))); gst_object_unref(GST_OBJECT(pad)); pad = gst_element_get_static_pad(rtpldacpay, "src"); - gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("src", pad)); + pa_assert_se(gst_element_add_pad(info->enc_bin, gst_ghost_pad_new("src", pad))); gst_object_unref(GST_OBJECT(pad)); return true;