summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/tags.c6
-rw-r--r--common/tags.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/common/tags.c b/common/tags.c
index f709cf0d5a..03765272df 100644
--- a/common/tags.c
+++ b/common/tags.c
@@ -61,6 +61,12 @@ void mp_tags_clear(struct mp_tags *tags)
talloc_free_children(tags);
}
+void mp_tags_merge(struct mp_tags *tags, struct mp_tags *src)
+{
+ for (int n = 0; n < src->num_keys; n++)
+ mp_tags_set_str(tags, src->keys[n], src->values[n]);
+}
+
void mp_tags_copy_from_av_dictionary(struct mp_tags *tags,
struct AVDictionary *av_dict)
{
diff --git a/common/tags.h b/common/tags.h
index 3bc0e6984b..4b7bcfa791 100644
--- a/common/tags.h
+++ b/common/tags.h
@@ -14,6 +14,7 @@ void mp_tags_set_bstr(struct mp_tags *tags, bstr key, bstr value);
char *mp_tags_get_str(struct mp_tags *tags, const char *key);
char *mp_tags_get_bstr(struct mp_tags *tags, bstr key);
void mp_tags_clear(struct mp_tags *tags);
+void mp_tags_merge(struct mp_tags *tags, struct mp_tags *src);
struct AVDictionary;
void mp_tags_copy_from_av_dictionary(struct mp_tags *tags,
struct AVDictionary *av_dict);