diff options
author | Jean CailleĢ <jean@stupeflix.com> | 2016-10-18 15:47:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-10-19 13:25:21 +0200 |
commit | 6498549fd75f679820a059a65ece1df4666aa46c (patch) | |
tree | e08b0df583d886040d11b12aac753e412d6ac424 /libavformat/mov.c | |
parent | 1aa8fa418a82211df447099a61c50bacde97be09 (diff) | |
download | ffmpeg-6498549fd75f679820a059a65ece1df4666aa46c.tar.gz |
lavf/mov: support gopro hero moments udta tag
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 9b400905df..dada1e07e0 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -268,6 +268,23 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext *pb, unsigned len) return av_dict_set(&c->fc->metadata, key, buf, 0); } +static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len) +{ + int i, n_hmmt; + + if (len < 2) + return 0; + if (c->ignore_chapters) + return 0; + + n_hmmt = avio_rb32(pb); + for (i = 0; i < n_hmmt && !pb->eof_reached; i++) { + int moment_time = avio_rb32(pb); + avpriv_new_chapter(c->fc, i, av_make_q(1, 1000), moment_time, AV_NOPTS_VALUE, NULL); + } + return 0; +} + static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) { char tmp_key[5]; @@ -303,6 +320,8 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) parse = mov_metadata_gnre; break; case MKTAG( 'h','d','v','d'): key = "hd_video"; parse = mov_metadata_int8_no_padding; break; + case MKTAG( 'H','M','M','T'): + return mov_metadata_hmmt(c, pb, atom.size); case MKTAG( 'k','e','y','w'): key = "keywords"; break; case MKTAG( 'l','d','e','s'): key = "synopsis"; break; case MKTAG( 'l','o','c','i'): |