OSDN Git Service

flacdec: account for frame and subframe header overhead when calculating
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 21 Mar 2009 01:27:28 +0000 (01:27 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 21 Mar 2009 01:27:28 +0000 (01:27 +0000)
estimate for maximum frame size

Originally committed as revision 18091 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/flacdec.c

index 3145d72..ec1ace4 100644 (file)
@@ -147,8 +147,7 @@ static void allocate_buffers(FLACContext *s)
     assert(s->max_blocksize);
 
     if (s->max_framesize == 0 && s->max_blocksize) {
-        // FIXME header overhead
-        s->max_framesize= (s->channels * s->bps * s->max_blocksize + 7)/ 8;
+        s->max_framesize = 23 + (s->channels * s->bps * s->max_blocksize + 7) / 8;
     }
 
     for (i = 0; i < s->channels; i++) {