{
int num, den, presentation_delayed, delay, i;
int64_t offset;
+ AVRational duration;
if (s->flags & AVFMT_FLAG_NOFILLIN)
return;
pkt->dts= AV_NOPTS_VALUE;
}
+ duration = av_mul_q((AVRational){pkt->duration, 1}, st->time_base);
if (pkt->duration == 0) {
ff_compute_frame_duration(&num, &den, st, pc, pkt);
if (den && num) {
+ duration = (AVRational){num, den};
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 || s->parse_queue))
update_initial_durations(s, st, pkt->stream_index, pkt->duration);
} else if (pkt->pts != AV_NOPTS_VALUE ||
pkt->dts != AV_NOPTS_VALUE ||
pkt->duration ) {
- int duration = pkt->duration;
/* presentation is not delayed : PTS and DTS are the same */
if (pkt->pts == AV_NOPTS_VALUE)
pkt->pts = st->cur_dts;
pkt->dts = pkt->pts;
if (pkt->pts != AV_NOPTS_VALUE)
- st->cur_dts = pkt->pts + duration;
+ st->cur_dts = av_add_stable(st->time_base, pkt->pts, duration, 1);
}
}