From 3feaf225b5a08349a6c12bbe9e87e1cce3f7838e Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Wed, 29 Dec 2021 15:47:42 +0100 Subject: [PATCH] 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. --- lib/gst/clapper/gstclapper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index 7f5315c2..cfdc6984 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -1868,10 +1868,12 @@ media_info_update (GstClapper * self, GstClapperMediaInfo * info) static void 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); - else + } else { *my_tags = gst_tag_list_ref (tags); + } } static void