Commit e9838d11 authored by bcoudurier's avatar bcoudurier

use utc time for timestamp and do not set it if not specified

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17971 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2b49ff4e
...@@ -1368,7 +1368,7 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt ...@@ -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) static uint64_t mxf_parse_timestamp(time_t timestamp)
{ {
struct tm *time = localtime(&timestamp); struct tm *time = gmtime(&timestamp);
return (uint64_t)(time->tm_year+1900) << 48 | return (uint64_t)(time->tm_year+1900) << 48 |
(uint64_t)(time->tm_mon+1) << 40 | (uint64_t)(time->tm_mon+1) << 40 |
(uint64_t) time->tm_mday << 32 | (uint64_t) time->tm_mday << 32 |
...@@ -1490,10 +1490,8 @@ static int mxf_write_header(AVFormatContext *s) ...@@ -1490,10 +1490,8 @@ static int mxf_write_header(AVFormatContext *s)
mxf->essence_container_count = 1; 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_gen_umid(s);
mxf->timestamp = mxf_parse_timestamp(s->timestamp);
}
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
MXFStreamContext *sc = s->streams[i]->priv_data; MXFStreamContext *sc = s->streams[i]->priv_data;
...@@ -1502,6 +1500,8 @@ static int mxf_write_header(AVFormatContext *s) ...@@ -1502,6 +1500,8 @@ static int mxf_write_header(AVFormatContext *s)
sc->order = AV_RB32(sc->track_essence_element_key+12); sc->order = AV_RB32(sc->track_essence_element_key+12);
} }
if (s->timestamp)
mxf->timestamp = mxf_parse_timestamp(s->timestamp);
mxf->duration = -1; mxf->duration = -1;
mxf->timecode_track = av_mallocz(sizeof(*mxf->timecode_track)); mxf->timecode_track = av_mallocz(sizeof(*mxf->timecode_track));
......
...@@ -9,10 +9,10 @@ c351132527ccb1e8cab06cc0822fde23 *./tests/data/b-libav.rm ...@@ -9,10 +9,10 @@ c351132527ccb1e8cab06cc0822fde23 *./tests/data/b-libav.rm
bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg
378880 ./tests/data/b-libav.mpg 378880 ./tests/data/b-libav.mpg
./tests/data/b-libav.mpg CRC=0x2b71a386 ./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 535097 ./tests/data/b-libav.mxf
./tests/data/b-libav.mxf CRC=0xd7ff387d ./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 5330989 ./tests/data/b-libav.mxf_d10
./tests/data/b-libav.mxf_d10 CRC=0xd241c8b6 ./tests/data/b-libav.mxf_d10 CRC=0xd241c8b6
c0cc2ae4df6a8b3df84986929a393116 *./tests/data/b-libav.ts c0cc2ae4df6a8b3df84986929a393116 *./tests/data/b-libav.ts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment