Ticket #460: indexCheck.patch

File indexCheck.patch, 1.4 KB (added by gbooker, 7 months ago)
  • ff_MovieImport.c

     
    480480        require_noerr(result,bail); 
    481481        storage->format_context = ic; 
    482482         
     483        // AVIs without an index currently add a few entries to the index so it can 
     484        // determine codec parameters.  Check for index existence here before it 
     485        // reads any packets. 
     486        hadIndex = 1; 
     487        for (j = 0; j < ic->nb_streams; j++) { 
     488                if (ic->streams[j]->nb_index_entries <= 1) 
     489                { 
     490                        hadIndex = 0; 
     491                        break; 
     492                } 
     493        } 
     494         
    483495        /* Get the Stream Infos if not already read */ 
    484496        result = av_find_stream_info(ic); 
    485497         
  • ff_private.c

     
    804804        ic = storage->format_context; 
    805805        header_offset = storage->header_offset; 
    806806 
    807         *hadIndex = 0; 
    808          
    809         // AVIs without an index currently add one entry to the index; assume that 
    810         // such a small index means that we should idle import instead. It shouldn't  
    811         // take much longer if the index really is this small anyways. 
    812         for (j = 0; j < ic->nb_streams; j++) { 
    813                 if (map[j].str->nb_index_entries <= 1) 
    814                         goto bail; 
    815         } 
    816          
     807        if(*hadIndex == 0) 
     808                goto bail; 
     809                 
    817810        //FLVs have unusable indexes, so don't even bother. 
    818811        if(storage->componentType == 'FLV ') 
    819812                goto bail;