summaryrefslogtreecommitdiff
path: root/libavcodec/flacenc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2009-03-21 01:54:31 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2009-03-21 01:54:31 +0000
commit0fb2182d469d09623cf2ff0e4b786981f2fbafbe (patch)
tree31505ac79ed335fcb07d0de76aabccc5b1a4abea /libavcodec/flacenc.c
parentf5187c7f0488722852f41249b49353c9cc856981 (diff)
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 Originally committed as revision 18092 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r--libavcodec/flacenc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index f51a4ee58b..b517cfa720 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -345,11 +345,8 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
s->options.lpc_coeff_precision);
/* set maximum encoded frame size in verbatim mode */
- if(s->channels == 2) {
- s->max_framesize = 14 + ((s->avctx->frame_size * 33 + 7) >> 3);
- } else {
- s->max_framesize = 14 + (s->avctx->frame_size * s->channels * 2);
- }
+ s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size,
+ s->channels, 16);
/* initialize MD5 context */
s->md5ctx = av_malloc(av_md5_size);