Revision 7c8202cc

View differences:

libavformat/avformat.h
522 522
     */
523 523
    unsigned int max_picture_buffer;
524 524

  
525
    int num_chapters;
525
    int nb_chapters;
526 526
    AVChapter **chapters;
527 527
} AVFormatContext;
528 528

  
libavformat/utils.c
2148 2148
    av_freep(&s->programs);
2149 2149
    flush_packet_queue(s);
2150 2150
    av_freep(&s->priv_data);
2151
    while(s->num_chapters--) {
2152
        av_free(s->chapters[s->num_chapters]->title);
2153
        av_free(s->chapters[s->num_chapters]);
2151
    while(s->nb_chapters--) {
2152
        av_free(s->chapters[s->nb_chapters]->title);
2153
        av_free(s->chapters[s->nb_chapters]);
2154 2154
    }
2155 2155
    av_freep(&s->chapters);
2156 2156
    av_free(s);
......
2239 2239
    AVChapter *chapter = NULL;
2240 2240
    int i;
2241 2241

  
2242
    for(i=0; i<s->num_chapters; i++)
2242
    for(i=0; i<s->nb_chapters; i++)
2243 2243
        if(s->chapters[i]->id == id)
2244 2244
            chapter = s->chapters[i];
2245 2245

  
......
2247 2247
        chapter= av_mallocz(sizeof(AVChapter));
2248 2248
        if(!chapter)
2249 2249
            return AVERROR(ENOMEM);
2250
        dynarray_add(&s->chapters, &s->num_chapters, chapter);
2250
        dynarray_add(&s->chapters, &s->nb_chapters, chapter);
2251 2251
    }
2252 2252
    if(chapter->title)
2253 2253
        av_free(chapter->title);

Also available in: Unified diff