changeset 5635:c6b8b3403a55 libavformat

Use av_compare_ts() for interleaving per dts.
author michael
date Sun, 07 Feb 2010 16:27:17 +0000
parents b280788e1936
children 7309cd6645b6
files utils.c
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Sun Feb 07 10:25:58 2010 +0000
+++ b/utils.c	Sun Feb 07 16:27:17 2010 +0000
@@ -2741,13 +2741,7 @@
 {
     AVStream *st = s->streams[ pkt ->stream_index];
     AVStream *st2= s->streams[ next->stream_index];
-    int64_t left = st2->time_base.num * (int64_t)st ->time_base.den;
-    int64_t right= st ->time_base.num * (int64_t)st2->time_base.den;
-
-    if (pkt->dts == AV_NOPTS_VALUE)
-        return 0;
-
-    return next->dts * left > pkt->dts * right; //FIXME this can overflow
+    return av_compare_ts(next->dts, st2->time_base, pkt->dts, st->time_base) > 0;
 }
 
 int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){