10l: fix bit count for frame header
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 31 Jul 2010 18:48:48 +0000 (18:48 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 31 Jul 2010 18:48:48 +0000 (18:48 +0000)
Originally committed as revision 24627 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/flacenc.c

index d9f9251..7d1e773 100644 (file)
@@ -945,7 +945,10 @@ static int count_frame_header(FlacEncodeContext *s)
     PUT_UTF8(s->frame_count, tmp, count += 8;)
 
     /* explicit block size */
-    count += FFMAX(0, s->frame.bs_code[0] - 5) * 8;
+    if (s->frame.bs_code[0] == 6)
+        count += 8;
+    else if (s->frame.bs_code[0] == 7)
+        count += 16;
 
     /* explicit sample rate */
     count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8;