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
This commit is contained in:
Baptiste Coudurier 2009-03-14 23:39:52 +00:00
parent 9bceffef3a
commit ed6ae6a58b
2 changed files with 6 additions and 6 deletions

View File

@ -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(&timestamp);
struct tm *time = gmtime(&timestamp);
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));

View File

@ -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