diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2009-02-27 23:12:14 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2009-02-27 23:12:14 +0000 |
commit | 73914d56d9b43ce9cc832e2c55cfd771c2d1ba3b (patch) | |
tree | e39f8120fc2967ccf0a9b87e8cbf4fdc3ae84598 /libavformat/nutenc.c | |
parent | 00798e456376a33bd3cfe1ff01082673db6feab9 (diff) | |
download | ffmpeg-73914d56d9b43ce9cc832e2c55cfd771c2d1ba3b.tar.gz |
use new metadata API in nut muxer
This is only a straight conversion of current code, so for now, it won't
mux generic metadata. It will only mux Title, Author and Copyright.
Originally committed as revision 17653 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/nutenc.c')
-rw-r--r-- | libavformat/nutenc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 3482d5234a..f89882b69f 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -448,6 +448,7 @@ static int add_info(ByteIOContext *bc, const char *type, const char *value){ static int write_globalinfo(NUTContext *nut, ByteIOContext *bc){ AVFormatContext *s= nut->avf; + AVMetadataTag *title, *author, *copyright; ByteIOContext *dyn_bc; uint8_t *dyn_buf=NULL; int count=0, dyn_size; @@ -455,9 +456,13 @@ static int write_globalinfo(NUTContext *nut, ByteIOContext *bc){ if(ret < 0) return ret; - if(s->title [0]) count+= add_info(dyn_bc, "Title" , s->title); - if(s->author [0]) count+= add_info(dyn_bc, "Author" , s->author); - if(s->copyright[0]) count+= add_info(dyn_bc, "Copyright", s->copyright); + title = av_metadata_get(s->metadata, "Title" , NULL, 0); + author = av_metadata_get(s->metadata, "Author" , NULL, 0); + copyright = av_metadata_get(s->metadata, "Copyright", NULL, 0); + + if(title ) count+= add_info(dyn_bc, "Title" , title->value); + if(author ) count+= add_info(dyn_bc, "Author" , author->value); + if(copyright) count+= add_info(dyn_bc, "Copyright", copyright->value); if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) count+= add_info(dyn_bc, "Encoder" , LIBAVFORMAT_IDENT); |