diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-07-07 11:25:03 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-07-12 15:30:10 +0200 |
commit | 5f847bf61dca1fd1a2f65a2f56c9a99d1cb716ab (patch) | |
tree | c6efb65d184923aa8b5e2eaa87336a59bdec4a1f /libavformat/movenc.c | |
parent | b12c2592525c3d8e12265a3d923a945d6f699a5b (diff) | |
download | ffmpeg-5f847bf61dca1fd1a2f65a2f56c9a99d1cb716ab.tar.gz |
lavf: deprecate AVFormatContext.timestamp
It's replaced by 'creation_time' metadata tag.
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index ae6f603e86..78e5db7444 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2129,6 +2129,7 @@ static int mov_write_header(AVFormatContext *s) { AVIOContext *pb = s->pb; MOVMuxContext *mov = s->priv_data; + AVDictionaryEntry *t; int i, hint_track = 0; if (!s->pb->seekable) { @@ -2259,7 +2260,18 @@ static int mov_write_header(AVFormatContext *s) } mov_write_mdat_tag(pb, mov); - mov->time = s->timestamp + 0x7C25B080; //1970 based -> 1904 based + +#if FF_API_TIMESTAMP + if (s->timestamp) + mov->time = s->timestamp; + else +#endif + if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) { + struct tm time = {0}; + strptime(t->value, "%Y - %m - %dT%T", &time); + mov->time = mktime(&time); + } + mov->time += 0x7C25B080; //1970 based -> 1904 based if (mov->chapter_track) mov_create_chapter_track(s, mov->chapter_track); |