comparison flacdec.c @ 9216:64246d9e583a libavcodec

add a function to calculate a more accurate estimate for maximum FLAC frame size and use the function in the FLAC decoder and FLAC encoder
author jbr
date Sat, 21 Mar 2009 01:54:31 +0000
parents d6b9123556fb
children 2b7bc08cf831
comparison
equal deleted inserted replaced
9215:d6b9123556fb 9216:64246d9e583a
145 int i; 145 int i;
146 146
147 assert(s->max_blocksize); 147 assert(s->max_blocksize);
148 148
149 if (s->max_framesize == 0 && s->max_blocksize) { 149 if (s->max_framesize == 0 && s->max_blocksize) {
150 s->max_framesize = 23 + (s->channels * s->bps * s->max_blocksize + 7) / 8; 150 s->max_framesize = ff_flac_get_max_frame_size(s->max_blocksize,
151 s->channels, s->bps);
151 } 152 }
152 153
153 for (i = 0; i < s->channels; i++) { 154 for (i = 0; i < s->channels; i++) {
154 s->decoded[i] = av_realloc(s->decoded[i], 155 s->decoded[i] = av_realloc(s->decoded[i],
155 sizeof(int32_t)*s->max_blocksize); 156 sizeof(int32_t)*s->max_blocksize);