comparison flacdec.c @ 9215:d6b9123556fb libavcodec

flacdec: account for frame and subframe header overhead when calculating estimate for maximum frame size
author jbr
date Sat, 21 Mar 2009 01:27:28 +0000
parents 782d31263979
children 64246d9e583a
comparison
equal deleted inserted replaced
9214:78b55e071bb9 9215:d6b9123556fb
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 // FIXME header overhead 150 s->max_framesize = 23 + (s->channels * s->bps * s->max_blocksize + 7) / 8;
151 s->max_framesize= (s->channels * s->bps * s->max_blocksize + 7)/ 8;
152 } 151 }
153 152
154 for (i = 0; i < s->channels; i++) { 153 for (i = 0; i < s->channels; i++) {
155 s->decoded[i] = av_realloc(s->decoded[i], 154 s->decoded[i] = av_realloc(s->decoded[i],
156 sizeof(int32_t)*s->max_blocksize); 155 sizeof(int32_t)*s->max_blocksize);