# HG changeset patch # User michael # Date 1265569804 0 # Node ID 7309cd6645b6bd403384fd3788ffbc614538e890 # Parent c6b8b3403a5574b76cedd8a2087cefc18ceced0a Directly use av_rescale_rnd() instead of av_convert_ts() as this cuts the number of calls to it down by 2. diff -r c6b8b3403a55 -r 7309cd6645b6 utils.c --- a/utils.c Sun Feb 07 16:27:17 2010 +0000 +++ b/utils.c Sun Feb 07 19:10:04 2010 +0000 @@ -2741,7 +2741,9 @@ { AVStream *st = s->streams[ pkt ->stream_index]; AVStream *st2= s->streams[ next->stream_index]; - return av_compare_ts(next->dts, st2->time_base, pkt->dts, st->time_base) > 0; + int64_t a= st2->time_base.num * (int64_t)st ->time_base.den; + int64_t b= st ->time_base.num * (int64_t)st2->time_base.den; + return av_rescale_rnd(pkt->dts, b, a, AV_ROUND_DOWN) < next->dts; } int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){