mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
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
1 changed files with 14 additions and 10 deletions
|
@ -594,11 +594,13 @@ gst_jpeg_parse_read_header (GstJpegParse * parse, GstBuffer * buffer)
|
|||
|
||||
if (tags) {
|
||||
GST_INFO_OBJECT (parse, "got exif metadata");
|
||||
if (!parse->priv->tags)
|
||||
parse->priv->tags = gst_tag_list_new ();
|
||||
gst_tag_list_insert (parse->priv->tags, tags,
|
||||
GST_TAG_MERGE_REPLACE);
|
||||
gst_tag_list_free (tags);
|
||||
if (parse->priv->tags) {
|
||||
gst_tag_list_insert (parse->priv->tags, tags,
|
||||
GST_TAG_MERGE_REPLACE);
|
||||
gst_tag_list_free (tags);
|
||||
} else {
|
||||
parse->priv->tags = tags;
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
GST_INFO_OBJECT (parse, "got xmp metadata");
|
||||
if (!parse->priv->tags)
|
||||
parse->priv->tags = gst_tag_list_new ();
|
||||
gst_tag_list_insert (parse->priv->tags, tags,
|
||||
GST_TAG_MERGE_REPLACE);
|
||||
gst_tag_list_free (tags);
|
||||
if (parse->priv->tags) {
|
||||
gst_tag_list_insert (parse->priv->tags, tags,
|
||||
GST_TAG_MERGE_REPLACE);
|
||||
gst_tag_list_free (tags);
|
||||
} else {
|
||||
parse->priv->tags = tags;
|
||||
}
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (parse, "parsed marker %x: '%s' %u bytes",
|
||||
|
|
Loading…
Reference in a new issue