diff options
author | Peter Ross <pross@xvid.org> | 2012-12-08 17:34:11 +1100 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2012-12-10 21:12:59 +1100 |
commit | f540851ce320bc69621ea70b89857c54129c82c2 (patch) | |
tree | 52cfac04bcd335e6a47611445c685db9b3bda9f1 | |
parent | e044cd4123faca906ae5c5108b7d2b6b173736cb (diff) | |
download | ffmpeg-f540851ce320bc69621ea70b89857c54129c82c2.tar.gz |
mov: parse @PRM and @PRQ metadata tags
These tags describe the product and quicktime library version respectively.
Originate from Adobe Premier, but some other products use them.
-rw-r--r-- | libavformat/mov.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 046e9b82ee..715e20039d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -278,6 +278,17 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len) return 0; } +static int mov_metadata_raw(MOVContext *c, AVIOContext *pb, + unsigned len, const char *key) +{ + char *value = av_malloc(len + 1); + if (!value) + return AVERROR(ENOMEM); + avio_read(pb, value, len); + value[len] = 0; + return av_dict_set(&c->fc->metadata, key, value, AV_DICT_DONT_STRDUP_VAL); +} + static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) { #ifdef MOV_EXPORT_ALL_METADATA @@ -334,6 +345,10 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) parse = mov_metadata_int8_no_padding; break; case MKTAG( 'p','g','a','p'): key = "gapless_playback"; parse = mov_metadata_int8_no_padding; break; + case MKTAG( '@','P','R','M'): + return mov_metadata_raw(c, pb, atom.size, "premiere_version"); + case MKTAG( '@','P','R','Q'): + return mov_metadata_raw(c, pb, atom.size, "quicktime_version"); } if (c->itunes_metadata && atom.size > 8) { |