Commit 72f80161 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Martin Storsjö

movenc: Adjust edit lists to trim out parts of tracks with negative pts

This makes sure that audio preroll for e.g. AAC is signaled correctly.

Previously we only wrote the edit list correctly if we had negative
dts but started with pts == 0 (e.g. for video with B-frames).
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 8bef4338
......@@ -1628,6 +1628,13 @@ static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
avio_wb32(pb, -1);
}
avio_wb32(pb, 0x00010000);
} else {
/* Avoid accidentally ending up with start_ct = -1 which has got a
* special meaning. Normally start_ct should end up positive or zero
* here, but use FFMIN in case dts is a a small positive integer
* rounded to 0 when represented in MOV_TIMESCALE units. */
start_ct = -FFMIN(track->cluster[0].dts, 0);
duration += delay;
}
/* duration */
......
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