Revision 30a43f2d libavformat/avidec.c

View differences:

libavformat/avidec.c
55 55
} AVIContext;
56 56

  
57 57
static int avi_load_index(AVFormatContext *s);
58
static int guess_ni_flag(AVFormatContext *s);
58 59

  
59 60
#ifdef DEBUG
60 61
static void print_tag(const char *str, unsigned int tag, int size)
......
118 119

  
119 120
    for(i=0; i<entries_in_use; i++){
120 121
        if(index_type){
121
            int64_t pos= get_le32(pb) + base;
122
            int64_t pos= get_le32(pb) + base - 8;
122 123
            int len    = get_le32(pb);
123

  
124
            av_add_index_entry(st, pos, ast->cum_len, 0, (len<0) ? 0 : AVINDEX_KEYFRAME);
124
            int key= len >= 0;
125 125
            len &= 0x7FFFFFFF;
126 126

  
127
//av_log(s, AV_LOG_ERROR, "pos:%Ld, len:%X\n", pos, len);
128
            av_add_index_entry(st, pos, ast->cum_len, len, 0, key ? AVINDEX_KEYFRAME : 0);
129

  
127 130
            if(ast->sample_size)
128 131
                ast->cum_len += len / ast->sample_size;
129 132
            else
......
412 415
    if(!avi->index_loaded)
413 416
        avi_load_index(s);
414 417
    avi->index_loaded = 1;
418
    avi->non_interleaved |= guess_ni_flag(s);
415 419

  
416 420
    return 0;
417 421
}
......
699 703
        if(last_pos == pos)
700 704
            avi->non_interleaved= 1;
701 705
        else
702
            av_add_index_entry(st, pos, ast->cum_len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0);
706
            av_add_index_entry(st, pos, ast->cum_len, len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0);
703 707
        if(ast->sample_size)
704 708
            ast->cum_len += len / ast->sample_size;
705 709
        else
......
768 772
        }
769 773
    }
770 774
 the_end:
771
    avi->non_interleaved |= guess_ni_flag(s);
772 775
    url_fseek(pb, pos, SEEK_SET);
773 776
    return 0;
774 777
}

Also available in: Unified diff