From 09b0f227ce6f15abc3996ca191a41606b44b7879 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 20 Apr 2015 14:11:15 +0200 Subject: [PATCH] avcodec/flacenc: also count wasted bits in subframe_count_exact() Signed-off-by: Michael Niedermayer --- libavcodec/flacenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 97867823d9..456b555aa7 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -528,6 +528,9 @@ static uint64_t subframe_count_exact(FlacEncodeContext *s, FlacSubframe *sub, /* subframe header */ count += 8; + if (sub->wasted) + count += sub->wasted; + /* subframe */ if (sub->type == FLAC_SUBFRAME_CONSTANT) { count += sub->obits;