Commit 28fbdece authored by Marton Balint's avatar Marton Balint

avformat: use ff_standardize_creation_time for formats writing all format string metadata

Reviewed-by: 's avatarwm4 <nfxjfg@googlemail.com>
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent e7dd97b5
...@@ -193,6 +193,7 @@ int ff_ape_write_tag(AVFormatContext *s) ...@@ -193,6 +193,7 @@ int ff_ape_write_tag(AVFormatContext *s)
APE_TAG_FLAG_IS_HEADER); APE_TAG_FLAG_IS_HEADER);
ffio_fill(dyn_bc, 0, 8); // reserved ffio_fill(dyn_bc, 0, 8); // reserved
ff_standardize_creation_time(s);
while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) { while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) {
int val_len; int val_len;
......
...@@ -175,6 +175,7 @@ static int caf_write_header(AVFormatContext *s) ...@@ -175,6 +175,7 @@ static int caf_write_header(AVFormatContext *s)
avio_write(pb, enc->extradata, enc->extradata_size); avio_write(pb, enc->extradata, enc->extradata_size);
} }
ff_standardize_creation_time(s);
if (av_dict_count(s->metadata)) { if (av_dict_count(s->metadata)) {
ffio_wfourcc(pb, "info"); //< Information chunk ffio_wfourcc(pb, "info"); //< Information chunk
while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {
......
...@@ -281,6 +281,7 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) ...@@ -281,6 +281,7 @@ static void write_metadata(AVFormatContext *s, unsigned int ts)
put_amf_double(pb, 0.0); put_amf_double(pb, 0.0);
} }
ff_standardize_creation_time(s);
while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
if( !strcmp(tag->key, "width") if( !strcmp(tag->key, "width")
||!strcmp(tag->key, "height") ||!strcmp(tag->key, "height")
......
...@@ -242,6 +242,7 @@ int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3) ...@@ -242,6 +242,7 @@ int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3)
ID3v2_ENCODING_UTF8; ID3v2_ENCODING_UTF8;
int i, ret; int i, ret;
ff_standardize_creation_time(s);
if ((ret = write_metadata(s->pb, &s->metadata, id3, enc)) < 0) if ((ret = write_metadata(s->pb, &s->metadata, id3, enc)) < 0)
return ret; return ret;
......
...@@ -52,6 +52,7 @@ static int lrc_write_header(AVFormatContext *s) ...@@ -52,6 +52,7 @@ static int lrc_write_header(AVFormatContext *s)
} }
avpriv_set_pts_info(s->streams[0], 64, 1, 100); 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); ff_metadata_conv_ctx(s, ff_lrc_metadata_conv, NULL);
if(!(s->flags & AVFMT_FLAG_BITEXACT)) { // avoid breaking regression tests if(!(s->flags & AVFMT_FLAG_BITEXACT)) { // avoid breaking regression tests
/* LRC provides a metadata slot for specifying encoder version /* LRC provides a metadata slot for specifying encoder version
......
...@@ -496,6 +496,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc) ...@@ -496,6 +496,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
if (ret < 0) if (ret < 0)
return ret; return ret;
ff_standardize_creation_time(s);
while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
count += add_info(dyn_bc, t->key, t->value); count += add_info(dyn_bc, t->key, t->value);
......
...@@ -46,6 +46,7 @@ static int smjpeg_write_header(AVFormatContext *s) ...@@ -46,6 +46,7 @@ static int smjpeg_write_header(AVFormatContext *s)
avio_wb32(pb, 0); avio_wb32(pb, 0);
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))) { while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {
avio_wl32(pb, SMJPEG_TXT); avio_wl32(pb, SMJPEG_TXT);
avio_wb32(pb, strlen(t->key) + strlen(t->value) + 3); avio_wb32(pb, strlen(t->key) + strlen(t->value) + 3);
......
...@@ -672,6 +672,7 @@ static void write_table_entries_attrib(AVFormatContext *s) ...@@ -672,6 +672,7 @@ static void write_table_entries_attrib(AVFormatContext *s)
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
AVDictionaryEntry *tag = 0; AVDictionaryEntry *tag = 0;
ff_standardize_creation_time(s);
//FIXME: translate special tags (e.g. WM/Bitrate) to binary representation //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation
ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL); ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL);
while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment