diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-05-20 18:34:44 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-05-20 18:34:44 +0000 |
commit | fbfccc0404e731defa881bb31f62ddf682c33de7 (patch) | |
tree | 1e71beb561445f21e2c3f4b748c31d25eb79a6cc | |
parent | b8dbff33bf1b5c3b2c3139cfe5360916ee9f153c (diff) | |
download | ffmpeg-fbfccc0404e731defa881bb31f62ddf682c33de7.tar.gz |
Disable non interleaved avi code when there is no index available.
Fixes issue1956.
Originally committed as revision 23202 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/avidec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index e866a93480..485c4eb93a 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -650,6 +650,16 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) avi_load_index(s); avi->index_loaded = 1; avi->non_interleaved |= guess_ni_flag(s); + for(i=0; i<s->nb_streams; i++){ + AVStream *st = s->streams[i]; + if(st->nb_index_entries) + break; + } + if(i==s->nb_streams && avi->non_interleaved) { + av_log(s, AV_LOG_WARNING, "non-interleaved AVI without index, switching to interleaved\n"); + avi->non_interleaved=0; + } + if(avi->non_interleaved) { av_log(s, AV_LOG_INFO, "non-interleaved AVI\n"); clean_index(s); |