[FFmpeg-cvslog] flvdec: Add comment about the 5 second threshold

Michael Niedermayer git at videolan.org
Fri Dec 30 20:36:39 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 30 20:28:47 2011 +0100| [bace181b48852ac668599a61d68dbc6eeb96c2e3] | committer: Michael Niedermayer

flvdec: Add comment about the 5 second threshold

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

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

 libavformat/flvdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 5aed3ed..2ebef63 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -196,7 +196,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
         size1 = avio_rb24(ioc);
         dts   = avio_rb24(ioc);
         dts  |= avio_r8(ioc) << 24;
-        if (size0 > filepositions[1] || FFABS(dts - times[1]*1000)>5000)
+        if (size0 > filepositions[1] || FFABS(dts - times[1]*1000)>5000/*arbitraray threshold to detect invalid index*/)
             goto invalid;
          for(i = 0; i < timeslen; i++)
              av_add_index_entry(vstream, filepositions[i], times[i]*1000, 0, 0, AVINDEX_KEYFRAME);



More information about the ffmpeg-cvslog mailing list