summaryrefslogtreecommitdiffstats
path: root/ext/kate/gstkateutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/kate/gstkateutil.c')
-rw-r--r--ext/kate/gstkateutil.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/kate/gstkateutil.c b/ext/kate/gstkateutil.c
index 78f18dae..b8915d70 100644
--- a/ext/kate/gstkateutil.c
+++ b/ext/kate/gstkateutil.c
@@ -185,7 +185,7 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
gst_pad_set_caps (srcpad, caps);
gst_caps_unref (caps);
if (decoder->k.ki->language && *decoder->k.ki->language) {
- GstTagList *tags = gst_tag_list_new ();
+ GstTagList *old = decoder->tags, *tags = gst_tag_list_new ();
if (tags) {
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_LANGUAGE_CODE,
decoder->k.ki->language, NULL);
@@ -193,6 +193,8 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
decoder->tags =
gst_tag_list_merge (decoder->tags, tags, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (tags);
+ if (old)
+ gst_tag_list_free (old);
}
}
@@ -212,7 +214,8 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
GST_INFO_OBJECT (element, "Parsed comments header");
{
gchar *encoder = NULL;
- GstTagList *list = gst_tag_list_from_vorbiscomment_buffer (buf,
+ GstTagList *old = decoder->tags, *list =
+ gst_tag_list_from_vorbiscomment_buffer (buf,
(const guint8 *) "\201kate\0\0\0\0", 9, &encoder);
if (list) {
decoder->tags =
@@ -235,6 +238,9 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
GST_TAG_ENCODER_VERSION, decoder->k.ki->bitstream_version_major,
NULL);
+ if (old)
+ gst_tag_list_free (old);
+
if (decoder->initialized) {
gst_element_found_tags_for_pad (element, srcpad, decoder->tags);
decoder->tags = NULL;