diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2009-02-17 21:40:38 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2009-02-17 21:40:38 +0000 |
commit | 7379d5bc0be5a1babfce8cd518c2329f05af3087 (patch) | |
tree | f63f011c3707565dea3f03c23fbeb41faf9c9845 /libavformat/rmenc.c | |
parent | 6c25f346820b1ec00982e857aec23be0ece47856 (diff) | |
download | ffmpeg-7379d5bc0be5a1babfce8cd518c2329f05af3087.tar.gz |
use new metadata API in rm (de)muxer
Originally committed as revision 17396 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rmenc.c')
-rw-r--r-- | libavformat/rmenc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c index b04b0e3f46..78b180f5fc 100644 --- a/libavformat/rmenc.c +++ b/libavformat/rmenc.c @@ -70,6 +70,7 @@ static void rv10_write_header(AVFormatContext *ctx, const char *desc, *mimetype; int nb_packets, packet_total_size, packet_max_size, size, packet_avg_size, i; int bit_rate, v, duration, flags, data_pos; + AVMetadataTag *tag; start_ptr = s->buf_ptr; @@ -123,14 +124,17 @@ static void rv10_write_header(AVFormatContext *ctx, /* comments */ put_tag(s,"CONT"); - size = strlen(ctx->title) + strlen(ctx->author) + strlen(ctx->copyright) + - strlen(ctx->comment) + 4 * 2 + 10; + size = 4 * 2 + 10; + for(i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) { + tag = av_metadata_get(ctx->metadata, ff_rm_metadata[i], NULL, 0); + if(tag) size += strlen(tag->value); + } put_be32(s,size); put_be16(s,0); - put_str(s, ctx->title); - put_str(s, ctx->author); - put_str(s, ctx->copyright); - put_str(s, ctx->comment); + for(i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) { + tag = av_metadata_get(ctx->metadata, ff_rm_metadata[i], NULL, 0); + put_str(s, tag ? tag->value : ""); + } for(i=0;i<ctx->nb_streams;i++) { int codec_data_size; |