diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-01-24 20:47:49 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-28 15:53:54 +0100 |
commit | 0dc379cfa66db7684339ef9e6c0bd8aaba64c06a (patch) | |
tree | 3bc61d450f4e8909c26ee8194a0adbabf1f9c9a3 | |
parent | b432d883e62386c9f07ce39b8a6916a644d4aba9 (diff) | |
download | ffmpeg-0dc379cfa66db7684339ef9e6c0bd8aaba64c06a.tar.gz |
avcodec/flacenc: fix calculation of bits required in case of custom sample rate
Sample rate of 11025 takes 16 bits but previous code would pick only 8.
Fixes assertion failure.
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 3e7d6849120d61bb354376d52786c26f20e20835)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/flacenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index be791b39df..6186c7c135 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1021,7 +1021,7 @@ static int count_frame_header(FlacEncodeContext *s) count += 16; /* explicit sample rate */ - count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8; + count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12) * 2) * 8; /* frame header CRC-8 */ count += 8; |