1
0
mirror of https://github.com/nu774/fdkaac.git synced 2025-06-05 23:29:14 +02:00

2 Commits

Author SHA1 Message Date
347e995cfc bump 2021-04-23 22:57:27 +09:00
9d65d3b3bf m4af: fix mvhd/tkhd duration
According to 14496-12, duration of mvhd/tkhd shall be the sum of
duration of edits
2021-04-23 22:53:46 +09:00
2 changed files with 7 additions and 3 deletions

View File

@ -1103,8 +1103,10 @@ void m4af_write_tkhd_box(m4af_ctx_t *ctx, uint32_t track_idx)
{
m4af_track_t *track = &ctx->track[track_idx];
int64_t pos = m4af_tell(ctx);
int64_t duration =
(double)track->duration / track->timescale * ctx->timescale + .5;
int64_t duration = track->duration;
if (ctx->priming_mode & M4AF_PRIMING_MODE_EDTS)
duration -= (track->encoder_delay + track->padding);
duration = (double)duration / track->timescale * ctx->timescale + .5;
uint8_t version = (track->creation_time > UINT32_MAX ||
track->modification_time > UINT32_MAX ||
duration > UINT32_MAX);
@ -1169,6 +1171,8 @@ int64_t m4af_movie_duration(m4af_ctx_t *ctx)
unsigned i;
for (i = 0; i < ctx->num_tracks; ++i) {
double x = ctx->track[i].duration;
if (ctx->priming_mode & M4AF_PRIMING_MODE_EDTS)
x -= (ctx->track[i].encoder_delay + ctx->track[i].padding);
int64_t duration = x / ctx->track[i].timescale * ctx->timescale + .5;
if (duration > movie_duration)
movie_duration = duration;

View File

@ -1,4 +1,4 @@
#ifndef VERSION_H
#define VERSION_H
const char *fdkaac_version = "1.0.1";
const char *fdkaac_version = "1.0.2";
#endif