Browse code

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>

Marton Balint authored on 2016/02/28 11:11:34
Showing 8 changed files
... ...
@@ -193,6 +193,7 @@ int ff_ape_write_tag(AVFormatContext *s)
193 193
                      APE_TAG_FLAG_IS_HEADER);
194 194
     ffio_fill(dyn_bc, 0, 8);             // reserved
195 195
 
196
+    ff_standardize_creation_time(s);
196 197
     while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) {
197 198
         int val_len;
198 199
 
... ...
@@ -175,6 +175,7 @@ static int caf_write_header(AVFormatContext *s)
175 175
         avio_write(pb, enc->extradata, enc->extradata_size);
176 176
     }
177 177
 
178
+    ff_standardize_creation_time(s);
178 179
     if (av_dict_count(s->metadata)) {
179 180
         ffio_wfourcc(pb, "info"); //< Information chunk
180 181
         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 281
         put_amf_double(pb, 0.0);
282 282
     }
283 283
 
284
+    ff_standardize_creation_time(s);
284 285
     while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
285 286
         if(   !strcmp(tag->key, "width")
286 287
             ||!strcmp(tag->key, "height")
... ...
@@ -242,6 +242,7 @@ int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3)
242 242
                                   ID3v2_ENCODING_UTF8;
243 243
     int i, ret;
244 244
 
245
+    ff_standardize_creation_time(s);
245 246
     if ((ret = write_metadata(s->pb, &s->metadata, id3, enc)) < 0)
246 247
         return ret;
247 248
 
... ...
@@ -52,6 +52,7 @@ static int lrc_write_header(AVFormatContext *s)
52 52
     }
53 53
     avpriv_set_pts_info(s->streams[0], 64, 1, 100);
54 54
 
55
+    ff_standardize_creation_time(s);
55 56
     ff_metadata_conv_ctx(s, ff_lrc_metadata_conv, NULL);
56 57
     if(!(s->flags & AVFMT_FLAG_BITEXACT)) { // avoid breaking regression tests
57 58
         /* LRC provides a metadata slot for specifying encoder version
... ...
@@ -496,6 +496,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
496 496
     if (ret < 0)
497 497
         return ret;
498 498
 
499
+    ff_standardize_creation_time(s);
499 500
     while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
500 501
         count += add_info(dyn_bc, t->key, t->value);
501 502
 
... ...
@@ -46,6 +46,7 @@ static int smjpeg_write_header(AVFormatContext *s)
46 46
     avio_wb32(pb, 0);
47 47
     avio_wb32(pb, 0);
48 48
 
49
+    ff_standardize_creation_time(s);
49 50
     while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX))) {
50 51
         avio_wl32(pb, SMJPEG_TXT);
51 52
         avio_wb32(pb, strlen(t->key) + strlen(t->value) + 3);
... ...
@@ -672,6 +672,7 @@ static void write_table_entries_attrib(AVFormatContext *s)
672 672
     AVIOContext *pb = s->pb;
673 673
     AVDictionaryEntry *tag = 0;
674 674
 
675
+    ff_standardize_creation_time(s);
675 676
     //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation
676 677
     ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL);
677 678
     while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))