Changeset 1242

Show
Ignore:
Timestamp:
01/09/10 03:32:39 (8 months ago)
Author:
astrange
Message:

Apply gbooker's patch fixing broken-index detection in the importer.

This allows incomplete AVI files to be fully imported again.

Closes #460

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/ff_MovieImport.c

    r1221 r1242  
    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); 
  • trunk/ff_private.c

    r1214 r1242  
    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 ')