Commit b7db90e4 authored by bcoudurier's avatar bcoudurier

fix endianness of time code, and calculate it in fields, according to specs

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16730 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f44fe3d9
...@@ -361,13 +361,11 @@ static int gxf_write_flt_packet(ByteIOContext *pb, GXFContext *ctx) ...@@ -361,13 +361,11 @@ static int gxf_write_flt_packet(ByteIOContext *pb, GXFContext *ctx)
static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx) static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx)
{ {
// XXX drop frame // XXX drop frame
int fps = ctx->sample_rate / 2;
int frames = ctx->nb_frames / 2;
uint32_t timecode = uint32_t timecode =
frames % fps << 24 | // frames ctx->nb_frames / ctx->sample_rate * 3600 % 24 << 27 | // hours
frames / fps % 60 << 16 | // seconds ctx->nb_frames / ctx->sample_rate * 60 % 60 << 16 | // minutes
frames / fps * 60 % 60 << 8 | // minutes ctx->nb_frames / ctx->sample_rate % 60 << 8 | // seconds
frames / fps * 3600 % 24 << 3; // hours ctx->nb_frames % ctx->sample_rate; // fields
put_le32(pb, ctx->flags); put_le32(pb, ctx->flags);
put_le32(pb, ctx->nb_frames); /* length of the longest track */ put_le32(pb, ctx->nb_frames); /* length of the longest track */
......
...@@ -27,7 +27,7 @@ af78858062599fcbba049e4a02588a15 *./tests/data/b-libav.mov ...@@ -27,7 +27,7 @@ af78858062599fcbba049e4a02588a15 *./tests/data/b-libav.mov
913b6199765b1dcba196706574621c2f *./tests/data/b-libav.dv 913b6199765b1dcba196706574621c2f *./tests/data/b-libav.dv
3600000 ./tests/data/b-libav.dv 3600000 ./tests/data/b-libav.dv
./tests/data/b-libav.dv CRC=0x7787e173 ./tests/data/b-libav.dv CRC=0x7787e173
ede81f26a3a68228d01124def788549d *./tests/data/b-libav.gxf 8441d11ebee0465f1a672586485f3506 *./tests/data/b-libav.gxf
805996 ./tests/data/b-libav.gxf 805996 ./tests/data/b-libav.gxf
./tests/data/b-libav.gxf CRC=0x9c06676e ./tests/data/b-libav.gxf CRC=0x9c06676e
66a6584f9e83e8ea3af822a3ba71fbbe *./tests/data/b-libav.nut 66a6584f9e83e8ea3af822a3ba71fbbe *./tests/data/b-libav.nut
......
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