From 0e1f78f90b7114abd6537cac6d2351450869dbaa Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 4 Apr 2010 22:19:42 +0000 Subject: [PATCH] Fix rounding direction for calculation of AVPacket.duration. Fixes issue1579 Originally committed as revision 22802 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 0cb5e4702e..5f9feec500 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -886,7 +886,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if (pkt->duration == 0) { compute_frame_duration(&num, &den, st, pc, pkt); if (den && num) { - pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num); + pkt->duration = av_rescale_rnd(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num, AV_ROUND_DOWN); if(pkt->duration != 0 && s->packet_buffer) update_initial_durations(s, st, pkt);