summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 16:45:56 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:14 +0200
commit7e209185f1fa804dda4474de7246a4d85418315e (patch)
treeee709c1236297a8757186907f8236315d979d02e /common
parent58880c00eeca254a5391dd61a920081bb16bc2c1 (diff)
downloadmpv-7e209185f1fa804dda4474de7246a4d85418315e.tar.bz2
mpv-7e209185f1fa804dda4474de7246a4d85418315e.tar.xz
demux, stream: change metadata notification
(Again.) This time, we simply make it event-based, as it should be. This is done for both demuxer metadata and stream metadata. For some ogg-over-icy streams, 2 updates are reported on stream start. This is because libavformat reports an update right on start, while including the same info in the "static" metadata. I don't know if that's a bug or a feature.
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);