summaryrefslogtreecommitdiff
path: root/libavformat/gxfenc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-01-20 09:14:46 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-01-20 09:14:46 +0000
commitfc94187857a67488f21e70c1fdc62eec7a7d80a0 (patch)
tree03a72ba214848fe335557b31e74fe4099c223b11 /libavformat/gxfenc.c
parent27cb512219c0b550eba75fd4af82f6f965883481 (diff)
fix gxf time code mark out value
Originally committed as revision 16697 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/gxfenc.c')
-rw-r--r--libavformat/gxfenc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 587e0d61ea..f483e31fd3 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -353,13 +353,22 @@ static int gxf_write_flt_packet(ByteIOContext *pb, GXFContext *ctx)
static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx)
{
+ // XXX drop frame
+ int fps = ctx->sample_rate / 2;
+ int frames = ctx->nb_frames / 2;
+ uint32_t timecode =
+ frames % fps << 24 | // frames
+ frames / fps % 60 << 16 | // seconds
+ frames / fps * 60 % 60 << 8 | // minutes
+ frames / fps * 3600 % 24 << 3; // hours
+
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 shortest track */
put_le32(pb, 0); /* mark in */
put_le32(pb, ctx->nb_frames); /* mark out */
put_le32(pb, 0); /* timecode mark in */
- put_le32(pb, ctx->nb_frames); /* timecode mark out */
+ put_le32(pb, timecode); /* timecode mark out */
put_le64(pb, ctx->fc->timestamp); /* modification time */
put_le64(pb, ctx->fc->timestamp); /* creation time */
put_le16(pb, 0); /* reserved */