Ticket #2145: avienc_strh_dwSuggestedBufferSize.patch

File avienc_strh_dwSuggestedBufferSize.patch, 861 bytes (added by tateu, 13 years ago)
  • libavformat/avienc.c

    diff --git a/libavformat/avienc.c b/libavformat/avienc.c
    index 15f0794..896ffa5 100644
    a b static int avi_write_trailer(AVFormatContext *s)  
    636636
    637637    for (i=0; i<s->nb_streams; i++) {
    638638         AVIStream *avist= s->streams[i]->priv_data;
     639         int dwSuggestedBufferSize = 0;
     640         for (j=0; j<avist->indexes.entry; j++) {
     641              AVIIentry* ie = avi_get_ientry(&avist->indexes, j);
     642              dwSuggestedBufferSize = FFMAX(dwSuggestedBufferSize, ie->len);
     643         }
     644         avio_seek(pb, avist->frames_hdr_strm + 4, SEEK_SET);
     645         avio_wl32(pb, dwSuggestedBufferSize);
    639646         for (j=0; j<avist->indexes.ents_allocated/AVI_INDEX_CLUSTER_SIZE; j++)
    640647              av_free(avist->indexes.cluster[j]);
    641648         av_freep(&avist->indexes.cluster);