avformat: use ff_standardize_creation_time for formats writing all format string metadata

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2016-02-28 03:11:34 +01:00
parent e7dd97b5d8
commit 28fbdece79
8 changed files with 8 additions and 0 deletions

View File

@ -193,6 +193,7 @@ int ff_ape_write_tag(AVFormatContext *s)
APE_TAG_FLAG_IS_HEADER);
ffio_fill(dyn_bc, 0, 8); // reserved
ff_standardize_creation_time(s);
while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) {
int val_len;

View File

@ -175,6 +175,7 @@ static int caf_write_header(AVFormatContext *s)
avio_write(pb, enc->extradata, enc->extradata_size);
}
ff_standardize_creation_time(s);
if (av_dict_count(s->metadata)) {
ffio_wfourcc(pb, "info"); //< Information chunk
while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {

View File

@ -281,6 +281,7 @@ static void write_metadata(AVFormatContext *s, unsigned int ts)
put_amf_double(pb, 0.0);
}
ff_standardize_creation_time(s);
while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
if( !strcmp(tag->key, "width")
||!strcmp(tag->key, "height")

View File

@ -242,6 +242,7 @@ int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3)
ID3v2_ENCODING_UTF8;
int i, ret;
ff_standardize_creation_time(s);
if ((ret = write_metadata(s->pb, &s->metadata, id3, enc)) < 0)
return ret;

View File

@ -52,6 +52,7 @@ static int lrc_write_header(AVFormatContext *s)
}
avpriv_set_pts_info(s->streams[0], 64, 1, 100);
ff_standardize_creation_time(s);
ff_metadata_conv_ctx(s, ff_lrc_metadata_conv, NULL);
if(!(s->flags & AVFMT_FLAG_BITEXACT)) { // avoid breaking regression tests
/* LRC provides a metadata slot for specifying encoder version

View File

@ -496,6 +496,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
if (ret < 0)
return ret;
ff_standardize_creation_time(s);
while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
count += add_info(dyn_bc, t->key, t->value);

View File

@ -46,6 +46,7 @@ static int smjpeg_write_header(AVFormatContext *s)
avio_wb32(pb, 0);
avio_wb32(pb, 0);
ff_standardize_creation_time(s);
while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {
avio_wl32(pb, SMJPEG_TXT);
avio_wb32(pb, strlen(t->key) + strlen(t->value) + 3);

View File

@ -672,6 +672,7 @@ static void write_table_entries_attrib(AVFormatContext *s)
AVIOContext *pb = s->pb;
AVDictionaryEntry *tag = 0;
ff_standardize_creation_time(s);
//FIXME: translate special tags (e.g. WM/Bitrate) to binary representation
ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL);
while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))