summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-12 22:37:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-12 22:39:17 +0200
commit031285dedf6638f0a84c2c4eb947d00f3fb32f2f (patch)
treefd03c858163da877cbcd9d0f3cab0bee305cfa35 /libavformat
parent5afe1233c591d661543d89b8bde613bf8bae75b0 (diff)
parent72f801619a1ae91969fee9a7d72519422433c998 (diff)
Merge commit '72f801619a1ae91969fee9a7d72519422433c998'
* commit '72f801619a1ae91969fee9a7d72519422433c998': movenc: Adjust edit lists to trim out parts of tracks with negative pts Conflicts: libavformat/movenc.c See: 66b45d8f7a1bfba1065286361ab571cb9cfd87c6 See: 14fd34d73bb0bcb227b62506fb51d63751c9b190 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 529b9d1b98..c7fc12da82 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2220,8 +2220,12 @@ static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
}
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. */
av_assert0(av_rescale_rnd(track->cluster[0].dts, MOV_TIMESCALE, track->timescale, AV_ROUND_DOWN) <= 0);
- start_ct = -FFMIN(track->cluster[0].dts, 0); //FFMIN needed due to rounding
+ start_ct = -FFMIN(track->cluster[0].dts, 0);
duration += delay;
}