x264enc: make tag event writable before modifying tag list in place
To modify an event tag is necessary to be sure that x264enc has its own copy. Also fix indentation. https://bugzilla.gnome.org/show_bug.cgi?id=640272
This commit is contained in:
parent
5ec02de6d4
commit
ead8d56f5f
@ -1498,6 +1498,9 @@ gst_x264_enc_sink_event (GstPad * pad, GstEvent * event)
|
|||||||
case GST_EVENT_TAG:{
|
case GST_EVENT_TAG:{
|
||||||
GstTagList *tags = NULL;
|
GstTagList *tags = NULL;
|
||||||
|
|
||||||
|
event =
|
||||||
|
GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
|
||||||
|
|
||||||
gst_event_parse_tag (event, &tags);
|
gst_event_parse_tag (event, &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);
|
||||||
@ -1505,10 +1508,10 @@ gst_x264_enc_sink_event (GstPad * pad, GstEvent * event)
|
|||||||
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_ENCODER, "x264",
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_ENCODER, "x264",
|
||||||
GST_TAG_ENCODER_VERSION, X264_BUILD, NULL);
|
GST_TAG_ENCODER_VERSION, X264_BUILD, NULL);
|
||||||
/* push is done below */
|
/* push is done below */
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
/* no flushing if flush received,
|
/* no flushing if flush received,
|
||||||
* buffers in encoder are considered (in the) past */
|
* buffers in encoder are considered (in the) past */
|
||||||
|
}
|
||||||
case GST_EVENT_CUSTOM_DOWNSTREAM:{
|
case GST_EVENT_CUSTOM_DOWNSTREAM:{
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
s = gst_event_get_structure (event);
|
s = gst_event_get_structure (event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user