x264enc: Fix unitialized variable and taglist event

This commit is contained in:
Matej Knopp 2012-06-20 13:36:25 -04:00 committed by Sebastian Dröge
parent ca77ad4e05
commit 711d2b18a7

View file

@ -1560,11 +1560,15 @@ gst_x264_enc_sink_event (GstVideoEncoder * encoder, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_TAG:{ case GST_EVENT_TAG:{
GstTagList *tags = NULL; GstTagList *tags = NULL;
const GstStructure *s;
event =
GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
gst_event_parse_tag (event, &tags); 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 */ /* 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_VIDEO_CODEC);
gst_tag_list_remove_tag (tags, GST_TAG_CODEC); gst_tag_list_remove_tag (tags, GST_TAG_CODEC);