fix bug where subframe bps estimate was not taking into account wasted bits

This commit is contained in:
Josh Coalson
2001-03-29 22:17:52 +00:00
parent bd646e12c1
commit 2cf7d007a2

View 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)) if(!FLAC__bitbuffer_read_unary_unsigned(&decoder->guts->input, &u, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */ return false; /* the read_callback_ sets the state for us */
decoder->guts->frame.subframes[channel].wasted_bits = u+1; decoder->guts->frame.subframes[channel].wasted_bits = u+1;
bps -= decoder->guts->frame.subframes[channel].wasted_bits;
} }
else else
decoder->guts->frame.subframes[channel].wasted_bits = 0; decoder->guts->frame.subframes[channel].wasted_bits = 0;