[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:51 CEST 2014


ffmpeg | branch: release/2.2 | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Jun 21 19:35:06 2014 +0200| [52572ca1b33932eb4db01acc1fb37e85264efbab] | 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=52572ca1b33932eb4db01acc1fb37e85264efbab
---

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

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 093e328..9bbc704 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