Mercurial > libavformat.hg
comparison gxfenc.c @ 4304:8880764c2012 libavformat
second try fixing time code in gxf
author | bcoudurier |
---|---|
date | Tue, 27 Jan 2009 23:44:11 +0000 |
parents | d9c25a41b461 |
children | bd49910ad4a0 |
comparison
equal
deleted
inserted
replaced
4303:a6789651f297 | 4304:8880764c2012 |
---|---|
360 | 360 |
361 static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx) | 361 static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx) |
362 { | 362 { |
363 // XXX drop frame | 363 // XXX drop frame |
364 uint32_t timecode = | 364 uint32_t timecode = |
365 ctx->nb_frames / ctx->sample_rate * 3600 % 24 << 27 | // hours | 365 ctx->nb_frames / (ctx->sample_rate * 3600) % 24 << 24 | // hours |
366 ctx->nb_frames / ctx->sample_rate * 60 % 60 << 16 | // minutes | 366 ctx->nb_frames / (ctx->sample_rate * 60) % 60 << 16 | // minutes |
367 ctx->nb_frames / ctx->sample_rate % 60 << 8 | // seconds | 367 ctx->nb_frames / ctx->sample_rate % 60 << 8 | // seconds |
368 ctx->nb_frames % ctx->sample_rate; // fields | 368 ctx->nb_frames % ctx->sample_rate; // fields |
369 | 369 |
370 put_le32(pb, ctx->flags); | 370 put_le32(pb, ctx->flags); |
371 put_le32(pb, ctx->nb_frames); /* length of the longest track */ | 371 put_le32(pb, ctx->nb_frames); /* length of the longest track */ |
372 put_le32(pb, ctx->nb_frames); /* length of the shortest track */ | 372 put_le32(pb, ctx->nb_frames); /* length of the shortest track */ |