Commit 0e1f78f9 authored by Michael Niedermayer's avatar Michael Niedermayer

Fix rounding direction for calculation of AVPacket.duration.

Fixes issue1579

Originally committed as revision 22802 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 3370289a
...@@ -886,7 +886,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, ...@@ -886,7 +886,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if (pkt->duration == 0) { if (pkt->duration == 0) {
compute_frame_duration(&num, &den, st, pc, pkt); compute_frame_duration(&num, &den, st, pc, pkt);
if (den && num) { 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) if(pkt->duration != 0 && s->packet_buffer)
update_initial_durations(s, st, pkt); update_initial_durations(s, st, pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment