diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-22 20:38:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-22 20:58:06 +0100 |
commit | 66b45d8f7a1bfba1065286361ab571cb9cfd87c6 (patch) | |
tree | a5bea8ddbabf84b8336564111349505e4643ebb2 /libavformat/movenc.c | |
parent | 32cd3a7c16e1d1b5633e72f42397e9cb218f5e2b (diff) | |
download | ffmpeg-66b45d8f7a1bfba1065286361ab571cb9cfd87c6.tar.gz |
movenc: fix assert failure caused by rounding.
Fixes Ticket1820
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f8ad73b32a..f08aa7e0db 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1721,8 +1721,8 @@ static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track) } avio_wb32(pb, 0x00010000); } else { - av_assert0(track->cluster[0].dts <= 0); - start_ct = -track->cluster[0].dts; + 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 duration += delay; } |