diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-03-14 23:39:52 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-03-14 23:39:52 +0000 |
commit | ed6ae6a58b8e2b6406bd6d4d4ab3de229ca7e7b7 (patch) | |
tree | 993d99cb9976a251d15d8eaf63b2b9fb147073c4 | |
parent | 9bceffef3a527ac3bd5023ee7799a5878cc914c6 (diff) | |
download | ffmpeg-ed6ae6a58b8e2b6406bd6d4d4ab3de229ca7e7b7.tar.gz |
use utc time for timestamp and do not set it if not specified
Originally committed as revision 17971 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/mxfenc.c | 8 | ||||
-rw-r--r-- | tests/libav.regression.ref | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 2732d8bbaa..ab8f36b487 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1368,7 +1368,7 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt static uint64_t mxf_parse_timestamp(time_t timestamp) { - struct tm *time = localtime(×tamp); + struct tm *time = gmtime(×tamp); return (uint64_t)(time->tm_year+1900) << 48 | (uint64_t)(time->tm_mon+1) << 40 | (uint64_t) time->tm_mday << 32 | @@ -1490,10 +1490,8 @@ static int mxf_write_header(AVFormatContext *s) mxf->essence_container_count = 1; } - if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { + if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) mxf_gen_umid(s); - mxf->timestamp = mxf_parse_timestamp(s->timestamp); - } for (i = 0; i < s->nb_streams; i++) { MXFStreamContext *sc = s->streams[i]->priv_data; @@ -1502,6 +1500,8 @@ static int mxf_write_header(AVFormatContext *s) sc->order = AV_RB32(sc->track_essence_element_key+12); } + if (s->timestamp) + mxf->timestamp = mxf_parse_timestamp(s->timestamp); mxf->duration = -1; mxf->timecode_track = av_mallocz(sizeof(*mxf->timecode_track)); diff --git a/tests/libav.regression.ref b/tests/libav.regression.ref index 27c2f38a10..017afd3e0a 100644 --- a/tests/libav.regression.ref +++ b/tests/libav.regression.ref @@ -9,10 +9,10 @@ c351132527ccb1e8cab06cc0822fde23 *./tests/data/b-libav.rm bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg 378880 ./tests/data/b-libav.mpg ./tests/data/b-libav.mpg CRC=0x2b71a386 -ece97d012890ba7f2371246a5f245561 *./tests/data/b-libav.mxf +259a87c8d22aab76665047ecdbfa9267 *./tests/data/b-libav.mxf 535097 ./tests/data/b-libav.mxf ./tests/data/b-libav.mxf CRC=0xd7ff387d -89fe0716dee263dd0f52b2d49ad87d38 *./tests/data/b-libav.mxf_d10 +0a7cc51de3da754ce36dffeeda290c45 *./tests/data/b-libav.mxf_d10 5330989 ./tests/data/b-libav.mxf_d10 ./tests/data/b-libav.mxf_d10 CRC=0xd241c8b6 c0cc2ae4df6a8b3df84986929a393116 *./tests/data/b-libav.ts |