diff options
author | Tomás Touceda <chiiph@gentoo.org> | 2010-09-11 03:29:07 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-09-11 03:29:07 +0400 |
commit | 16f825085a53dc7241ef375e9bed9856435d4c16 (patch) | |
tree | ea8d030ccf814af3cbf909f7ff8663b1a6ccce1b /libavformat | |
parent | c7bb7eff818cb91d6f49da2fe810127ae7184758 (diff) |
FLV Metadata
Patch by Tomás Touceda, chiiph gentoo org
Originally committed as revision 25101 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/flvenc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index bbf91ff00b..29b7b1d1ef 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -22,6 +22,7 @@ #include "flv.h" #include "internal.h" #include "avc.h" +#include "metadata.h" #undef NDEBUG #include <assert.h> @@ -176,6 +177,7 @@ static int flv_write_header(AVFormatContext *s) int i; double framerate = 0.0; int metadata_size_pos, data_size; + AVMetadataTag *tag = NULL; for(i=0; i<s->nb_streams; i++){ AVCodecContext *enc = s->streams[i]->codec; @@ -272,6 +274,12 @@ static int flv_write_header(AVFormatContext *s) put_amf_double(pb, audio_enc->codec_tag); } + while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) { + put_amf_string(pb, tag->key); + put_byte(pb, AMF_DATA_TYPE_STRING); + put_amf_string(pb, tag->value); + } + put_amf_string(pb, "filesize"); flv->filesize_offset= url_ftell(pb); put_amf_double(pb, 0); // delayed write |