[FFmpeg-cvslog] avformat/asfdec: Avoid float usage in duration calculation

Michael Niedermayer git at videolan.org
Tue May 26 13:52:26 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 26 13:02:25 2015 +0200| [f902b0b2cbdcb21c6c888819fbc51de2168d7d5a] | committer: Michael Niedermayer

avformat/asfdec: Avoid float usage in duration calculation

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f902b0b2cbdcb21c6c888819fbc51de2168d7d5a
---

 libavformat/asfdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 359ee8b..9278434 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -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;
     }



More information about the ffmpeg-cvslog mailing list