diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-07-13 00:42:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-07-13 00:42:11 +0200 |
commit | bb258fb995a42112d1fe14f53ec599b2cd19b707 (patch) | |
tree | d7152f06fcff2c66509c57a5dd906ca225069ae1 /libavformat/movenc.c | |
parent | 896e59758a11ff645879098b5ebca2e753731b4e (diff) | |
parent | 2cb6dec61c8e6676105de628ba20a5b3d162976e (diff) | |
download | ffmpeg-bb258fb995a42112d1fe14f53ec599b2cd19b707.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
doc: Improve references to external URLs.
h264: move decode_mb_skip() from h264.h to h.264_mvpred.h
ffplay: skip return value of avcodec_decode_video2 / avcodec_decode_subtitle2
dnxhdenc: Replace a forward declaration by the proper #include.
h264: move h264_mvpred.h include.
pix_fmt: Fix number of bits per component in yuv444p9be
lavf: deprecate AVFormatContext.timestamp
ffmpeg: merge input_files_ts_scale into InputStream.
ffmpeg: don't abuse a global for passing sample format from input to output
ffmpeg: don't abuse a global for passing channel layout from input to output
ffmpeg: factor common code from new_a/v/s/d_stream to new_output_stream()
matroskaenc: make SSA default subtitle codec.
oggdec: prevent heap corruption.
Conflicts:
doc/developer.texi
doc/faq.texi
doc/general.texi
ffmpeg.c
ffplay.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 b0cdcbc87c..41c59d49c1 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2142,6 +2142,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) { @@ -2272,7 +2273,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); |