Commit 3e7d6849 authored by Paul B Mahol's avatar Paul B Mahol

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: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent ce36cb08
......@@ -1023,7 +1023,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment