diff utils.c @ 5934:d9f196991fe4 libavformat

Fix rounding direction for calculation of AVPacket.duration. Fixes issue1579
author michael
date Sun, 04 Apr 2010 22:19:42 +0000
parents 6cc73b15aa28
children bde9a4b67f86
line wrap: on
line diff
--- a/utils.c	Sun Apr 04 21:59:06 2010 +0000
+++ b/utils.c	Sun Apr 04 22:19:42 2010 +0000
@@ -886,7 +886,7 @@
     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);