Mercurial > libavformat.hg
comparison gxfenc.c @ 4260:40528f55532c libavformat
fix gxf time code mark out value
author | bcoudurier |
---|---|
date | Tue, 20 Jan 2009 09:14:46 +0000 |
parents | 77e0c7511d41 |
children | af29578c3d77 |
comparison
equal
deleted
inserted
replaced
4259:6cc23cc61648 | 4260:40528f55532c |
---|---|
351 } | 351 } |
352 #endif | 352 #endif |
353 | 353 |
354 static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx) | 354 static int gxf_write_umf_material_description(ByteIOContext *pb, GXFContext *ctx) |
355 { | 355 { |
356 // XXX drop frame | |
357 int fps = ctx->sample_rate / 2; | |
358 int frames = ctx->nb_frames / 2; | |
359 uint32_t timecode = | |
360 frames % fps << 24 | // frames | |
361 frames / fps % 60 << 16 | // seconds | |
362 frames / fps * 60 % 60 << 8 | // minutes | |
363 frames / fps * 3600 % 24 << 3; // hours | |
364 | |
356 put_le32(pb, ctx->flags); | 365 put_le32(pb, ctx->flags); |
357 put_le32(pb, ctx->nb_frames); /* length of the longest track */ | 366 put_le32(pb, ctx->nb_frames); /* length of the longest track */ |
358 put_le32(pb, ctx->nb_frames); /* length of the shortest track */ | 367 put_le32(pb, ctx->nb_frames); /* length of the shortest track */ |
359 put_le32(pb, 0); /* mark in */ | 368 put_le32(pb, 0); /* mark in */ |
360 put_le32(pb, ctx->nb_frames); /* mark out */ | 369 put_le32(pb, ctx->nb_frames); /* mark out */ |
361 put_le32(pb, 0); /* timecode mark in */ | 370 put_le32(pb, 0); /* timecode mark in */ |
362 put_le32(pb, ctx->nb_frames); /* timecode mark out */ | 371 put_le32(pb, timecode); /* timecode mark out */ |
363 put_le64(pb, ctx->fc->timestamp); /* modification time */ | 372 put_le64(pb, ctx->fc->timestamp); /* modification time */ |
364 put_le64(pb, ctx->fc->timestamp); /* creation time */ | 373 put_le64(pb, ctx->fc->timestamp); /* creation time */ |
365 put_le16(pb, 0); /* reserved */ | 374 put_le16(pb, 0); /* reserved */ |
366 put_le16(pb, 0); /* reserved */ | 375 put_le16(pb, 0); /* reserved */ |
367 put_le16(pb, ctx->audio_tracks); | 376 put_le16(pb, ctx->audio_tracks); |