avformat/asfdec: Avoid float usage in duration calculation
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 26 May 2015 11:02:25 +0000 (13:02 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 26 May 2015 11:51:29 +0000 (13:51 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/asfdec.c

index 359ee8b..9278434 100644 (file)
@@ -380,7 +380,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
     if (!(asf->hdr.flags & 0x01)) { // if we aren't streaming...
         int64_t fsize = avio_size(pb);
         if (fsize <= 0 || (int64_t)asf->hdr.file_size <= 0 ||
-            FFABS(fsize - (int64_t)asf->hdr.file_size) / (float)FFMIN(fsize, asf->hdr.file_size) < 0.05)
+            20*FFABS(fsize - (int64_t)asf->hdr.file_size) < FFMIN(fsize, asf->hdr.file_size))
             st->duration = asf->hdr.play_time /
                        (10000000 / 1000) - start_time;
     }