changeset 6023:d679feb6ead1 libavformat

Disable non interleaved avi code when there is no index available. Fixes issue1956.
author michael
date Thu, 20 May 2010 18:34:44 +0000
parents 56e0040a97e6
children ee42a04b24f2
files avidec.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/avidec.c	Wed May 19 16:50:12 2010 +0000
+++ b/avidec.c	Thu May 20 18:34:44 2010 +0000
@@ -650,6 +650,16 @@
         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);