[FFmpeg-cvslog] r21676 - trunk/libavformat/utils.c

michael subversion
Sun Feb 7 20:10:04 CET 2010


Author: michael
Date: Sun Feb  7 20:10:04 2010
New Revision: 21676

Log:
Directly use av_rescale_rnd() instead of av_convert_ts() as this cuts the
number of calls to it down by 2.

Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Sun Feb  7 18:40:22 2010	(r21675)
+++ trunk/libavformat/utils.c	Sun Feb  7 20:10:04 2010	(r21676)
@@ -2741,7 +2741,9 @@ int ff_interleave_compare_dts(AVFormatCo
 {
     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){



More information about the ffmpeg-cvslog mailing list