diff 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
line wrap: on
line diff
--- a/flacdec.c	Sat Mar 21 01:27:28 2009 +0000
+++ b/flacdec.c	Sat Mar 21 01:54:31 2009 +0000
@@ -147,7 +147,8 @@
     assert(s->max_blocksize);
 
     if (s->max_framesize == 0 && s->max_blocksize) {
-        s->max_framesize = 23 + (s->channels * s->bps * s->max_blocksize + 7) / 8;
+        s->max_framesize = ff_flac_get_max_frame_size(s->max_blocksize,
+                                                      s->channels, s->bps);
     }
 
     for (i = 0; i < s->channels; i++) {