From: Arun Raghavan Date: Thu, 22 Oct 2020 13:17:26 +0000 (-0400) Subject: rtputils: Count metas with an empty tag list for copying/keeping X-Git-Tag: 1.19.3~509^2~376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4a713ff2d7f67efbf27c91b3da69a7ac0bffc7c;p=platform%2Fupstream%2Fgstreamer.git rtputils: Count metas with an empty tag list for copying/keeping The GstMetaInfos registered in core do not set their tags to NULL, but instead use an empty list (non-NULL list with a single NULL value). Let's check explicitly for that so as to not miss some metas. Part-of: --- diff --git a/gst/rtp/gstrtputils.c b/gst/rtp/gstrtputils.c index 7ad981a..4d86fb2 100644 --- a/gst/rtp/gstrtputils.c +++ b/gst/rtp/gstrtputils.c @@ -39,7 +39,7 @@ foreach_metadata_copy (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data) const GstMetaInfo *info = (*meta)->info; const gchar *const *tags = gst_meta_api_type_get_tags (info->api); - if (info->transform_func && (!tags || (copy_tag != 0 + if (info->transform_func && (!tags || !tags[0] || (copy_tag != 0 && g_strv_length ((gchar **) tags) == 1 && gst_meta_api_type_has_tag (info->api, copy_tag)))) { GstMetaTransformCopy copy_data = { FALSE, 0, -1 }; @@ -94,7 +94,8 @@ foreach_metadata_drop (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data) const GstMetaInfo *info = (*meta)->info; const gchar *const *tags = gst_meta_api_type_get_tags (info->api); - if (!tags || (keep_tag != 0 && g_strv_length ((gchar **) tags) == 1 + if (!tags || !tags[0] || (keep_tag != 0 + && g_strv_length ((gchar **) tags) == 1 && gst_meta_api_type_has_tag (info->api, keep_tag))) { GST_DEBUG_OBJECT (element, "keeping metadata %s", g_type_name (info->api)); } else {