[FFmpeg-cvslog] Show duration for large asf files as written in the file header.

Carl Eugen Hoyos git at videolan.org
Sat Jun 21 23:09:45 CEST 2014


ffmpeg | branch: release/2.1 | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Jun 21 19:35:06 2014 +0200| [f3802aa3250c1b1315f17691724498ebcfd3ff15] | committer: Carl Eugen Hoyos

Show duration for large asf files as written in the file header.

Fixes ticket #3428.
(cherry picked from commit e3fd263f0b73e4425192d6dd1ab18027ecaa35db)

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

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

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index d6378e9..fe4c3f3 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -370,7 +370,8 @@ 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) < 10000)
+        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)
             st->duration = asf->hdr.play_time /
                        (10000000 / 1000) - start_time;
     }



More information about the ffmpeg-cvslog mailing list