jpegparse: Small optimization on tags parsing
Optimize a little avoiding copying a taglist when parsing xmp/exif data.
This commit is contained in:
parent
8d5cfc6511
commit
7622328aab
@ -594,11 +594,13 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer)
|
|||||||
|
|
||||||
if (tags) {
|
if (tags) {
|
||||||
GST_INFO_OBJECT (parse, "got exif metadata");
|
GST_INFO_OBJECT (parse, "got exif metadata");
|
||||||
if (!parse->priv->tags)
|
if (parse->priv->tags) {
|
||||||
parse->priv->tags = gst_tag_list_new ();
|
gst_tag_list_insert (parse->priv->tags, tags,
|
||||||
gst_tag_list_insert (parse->priv->tags, tags,
|
GST_TAG_MERGE_REPLACE);
|
||||||
GST_TAG_MERGE_REPLACE);
|
gst_tag_list_free (tags);
|
||||||
gst_tag_list_free (tags);
|
} else {
|
||||||
|
parse->priv->tags = tags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (parse, "parsed marker %x: '%s' %u bytes",
|
GST_LOG_OBJECT (parse, "parsed marker %x: '%s' %u bytes",
|
||||||
@ -621,11 +623,13 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer)
|
|||||||
|
|
||||||
if (tags) {
|
if (tags) {
|
||||||
GST_INFO_OBJECT (parse, "got xmp metadata");
|
GST_INFO_OBJECT (parse, "got xmp metadata");
|
||||||
if (!parse->priv->tags)
|
if (parse->priv->tags) {
|
||||||
parse->priv->tags = gst_tag_list_new ();
|
gst_tag_list_insert (parse->priv->tags, tags,
|
||||||
gst_tag_list_insert (parse->priv->tags, tags,
|
GST_TAG_MERGE_REPLACE);
|
||||||
GST_TAG_MERGE_REPLACE);
|
gst_tag_list_free (tags);
|
||||||
gst_tag_list_free (tags);
|
} else {
|
||||||
|
parse->priv->tags = tags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (parse, "parsed marker %x: '%s' %u bytes",
|
GST_LOG_OBJECT (parse, "parsed marker %x: '%s' %u bytes",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user