diff options
author | Kharkov Alexander <kharkovalexander@gmail.com> | 2011-04-08 16:20:45 +0700 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-04-12 12:38:45 +0300 |
commit | b5304f7b2ec56b872e9a007d7f040930ebe55095 (patch) | |
tree | 938f2b9b7e0e4ca749c5c1fe85d29876baaac6b5 | |
parent | c41eb2ade4f862dc5f5e7c09c717d4f7f911a15e (diff) | |
download | ffmpeg-streaming-b5304f7b2ec56b872e9a007d7f040930ebe55095.zip ffmpeg-streaming-b5304f7b2ec56b872e9a007d7f040930ebe55095.tar.gz |
flvdec: Fix support for flvtool2 "keyframes based" generated index
Current keyframes data parser unconditionally rewind metadata to
the end at the end of function. As result ALL metadata located
after keyframes index not parsed, and as metadata object can have
ANY placement inside metadata it can lead to unpredictable result
(bitrate can not be found, etc.). As result FLV movie will not
play at all in such situation.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/flvdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index f27b70c..62d25c8 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -136,6 +136,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream int64_t *times = NULL; int64_t *filepositions = NULL; int ret = 0; + int64_t initial_pos = avio_tell(ioc); while (avio_tell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) { int64_t* current_array; @@ -183,7 +184,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream finish: av_freep(×); av_freep(&filepositions); - avio_seek(ioc, max_pos, SEEK_SET); + avio_seek(ioc, initial_pos, SEEK_SET); return ret; } |