changeset 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 2dbc910a7002
children bd378c64a9f5
files utils.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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);