[FFmpeg-cvslog] movenc: fix assert failure caused by rounding.

Michael Niedermayer git at videolan.org
Thu Nov 22 20:58:32 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov 22 20:38:51 2012 +0100| [66b45d8f7a1bfba1065286361ab571cb9cfd87c6] | committer: Michael Niedermayer

movenc: fix assert failure caused by rounding.

Fixes Ticket1820

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66b45d8f7a1bfba1065286361ab571cb9cfd87c6
---

 libavformat/movenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f8ad73b..f08aa7e 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;
     }
 



More information about the ffmpeg-cvslog mailing list