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 /libavformat/mxfenc.c | |
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
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r-- | libavformat/mxfenc.c | 8 |
1 files changed, 4 insertions, 4 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)); |