fix bug where subframe bps estimate was not taking into account wasted bits
authorJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 29 Mar 2001 22:17:52 +0000 (22:17 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 29 Mar 2001 22:17:52 +0000 (22:17 +0000)
src/libFLAC/stream_decoder.c

index 578d1c5..91327fa 100644 (file)
@@ -1039,6 +1039,7 @@ bool stream_decoder_read_subframe_(FLAC__StreamDecoder *decoder, unsigned channe
                if(!FLAC__bitbuffer_read_unary_unsigned(&decoder->guts->input, &u, read_callback_, decoder))
                        return false; /* the read_callback_ sets the state for us */
                decoder->guts->frame.subframes[channel].wasted_bits = u+1;
                if(!FLAC__bitbuffer_read_unary_unsigned(&decoder->guts->input, &u, read_callback_, decoder))
                        return false; /* the read_callback_ sets the state for us */
                decoder->guts->frame.subframes[channel].wasted_bits = u+1;
+               bps -= decoder->guts->frame.subframes[channel].wasted_bits;
        }
        else
                decoder->guts->frame.subframes[channel].wasted_bits = 0;
        }
        else
                decoder->guts->frame.subframes[channel].wasted_bits = 0;