From 711d2b18a7cccf8216cea133b5a0079296c680b4 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Wed, 20 Jun 2012 13:36:25 -0400 Subject: [PATCH] x264enc: Fix unitialized variable and taglist event --- ext/x264/gstx264enc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 48a50ca6f3..832b1dcfb2 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -1560,11 +1560,15 @@ gst_x264_enc_sink_event (GstVideoEncoder * encoder, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_TAG:{ GstTagList *tags = NULL; - - event = - GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event))); + const GstStructure *s; gst_event_parse_tag (event, &tags); + tags = gst_tag_list_copy (tags); + s = gst_event_get_structure (event); + + gst_event_take (&event, gst_event_new_tag (gst_structure_get_name (s), + tags)); + /* drop codec/video-codec and replace encoder/encoder-version */ gst_tag_list_remove_tag (tags, GST_TAG_VIDEO_CODEC); gst_tag_list_remove_tag (tags, GST_TAG_CODEC);