Fix rounding direction for calculation of AVPacket.duration.

Fixes issue1579

Originally committed as revision 22802 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Michael Niedermayer 15 years ago
parent 3370289a4c
commit 0e1f78f90b
  1. 2
      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);

Loading…
Cancel
Save