diff options
author | wm4 <wm4@nowhere> | 2013-09-08 07:42:05 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-08 07:43:23 +0200 |
commit | 35fd083828a57eb7ae995bd081dad88a8d64f75d (patch) | |
tree | b6f377dceee9ad4f888bb44d0842a00fc4ee3d04 /demux/demux_lavf.c | |
parent | ba07000b886802909a52810568705897d600263a (diff) | |
download | mpv-35fd083828a57eb7ae995bd081dad88a8d64f75d.tar.bz2 mpv-35fd083828a57eb7ae995bd081dad88a8d64f75d.tar.xz |
demux: retrieve per-chapter metadata
Retrieve per-chapter metadata, but don't do much with it. We just make
the metadata of the _current_ chapter available as chapter-metadata
property. Returning the full chapter list with metadata would be no
problem, except that the property interface isn't really good with
structured data, so it's not available for now.
Not sure if it's worth it, but it was requested via github issue #201.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 908eb3c111..dbe16a76b9 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -627,7 +627,12 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check) (AVRational){1, 1000000000}); t = av_dict_get(c->metadata, "title", NULL, 0); demuxer_add_chapter(demuxer, t ? bstr0(t->value) : bstr0(NULL), - start, end); + start, end, i); + AVDictionaryEntry *t = NULL; + while ((t = av_dict_get(c->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { + demuxer_add_chapter_info(demuxer, i, bstr0(t->key), + bstr0(t->value)); + } } add_new_streams(demuxer); |