gstclapper: Make tags writable before insert

Someone might be holding a copied media info in which case tag
list ref count is not 1. Use gst_tag_list_make_writable to
assure that ref count is 1, so we can insert more tags into the list.
This commit is contained in:
Rafostar
2021-12-29 15:47:42 +01:00
parent ac76836fd7
commit 3feaf225b5

View File

@@ -1868,10 +1868,12 @@ media_info_update (GstClapper * self, GstClapperMediaInfo * info)
static void static void
merge_tags (GstTagList **my_tags, GstTagList *tags) merge_tags (GstTagList **my_tags, GstTagList *tags)
{ {
if (*my_tags) if (*my_tags) {
*my_tags = gst_tag_list_make_writable (*my_tags);
gst_tag_list_insert (*my_tags, tags, GST_TAG_MERGE_REPLACE); gst_tag_list_insert (*my_tags, tags, GST_TAG_MERGE_REPLACE);
else } else {
*my_tags = gst_tag_list_ref (tags); *my_tags = gst_tag_list_ref (tags);
}
} }
static void static void