aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-07 19:10:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-07 19:10:04 +0000
commite6406939a833561b60cdc25682dcaca7c457ddbf (patch)
treecd9ddc30feb931312c1496aa2a30e7bb29a44749
parent464baa6650b4c5ac2448d5c3292d22b7f84357ae (diff)
downloadffmpeg-e6406939a833561b60cdc25682dcaca7c457ddbf.tar.gz
Directly use av_rescale_rnd() instead of av_convert_ts() as this cuts the
number of calls to it down by 2. Originally committed as revision 21676 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ef27e7e090..34a7b72505 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2741,7 +2741,9 @@ int ff_interleave_compare_dts(AVFormatContext *s, AVPacket *next, AVPacket *pkt)
{
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){