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

Carl Eugen Hoyos git at videolan.org
Sat Jun 21 20:15:45 CEST 2014


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

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

Fixes ticket #3428.

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

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

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 03f4b20..7b4a0a5 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -372,7 +372,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