From: Andre Noll Date: Sat, 6 Feb 2016 06:19:53 +0000 (+0100) Subject: wmadec: Make pwd->reset_block_lengths a boolean. X-Git-Tag: v0.5.6~32^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f60abbe18364a4368fd756f48c79af67d377fca7 wmadec: Make pwd->reset_block_lengths a boolean. This field is already used as such. Improve the documentation while at it. --- diff --git a/wmadec_filter.c b/wmadec_filter.c index c1f0c302..6348adda 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -88,8 +88,8 @@ struct private_wmadec_data { int frame_len_bits; /** Number of block sizes, one if !ahi->use_variable_block_len. */ int nb_block_sizes; - /* block info */ - int reset_block_lengths; + /* Whether to update block lengths from getbit context. */ + bool reset_block_lengths; /** log2 of current block length. */ int block_len_bits; /** log2 of next block length. */ @@ -391,7 +391,7 @@ static int wma_init(struct private_wmadec_data *pwd) pwd->windows[i] = sine_windows[pwd->frame_len_bits - i - 7]; } - pwd->reset_block_lengths = 1; + pwd->reset_block_lengths = true; if (pwd->use_noise_coding) { /* init the noise generator */ @@ -834,7 +834,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) n = wma_log2(pwd->nb_block_sizes - 1) + 1; if (pwd->reset_block_lengths) { - pwd->reset_block_lengths = 0; + pwd->reset_block_lengths = false; v = get_bits(&pwd->gb, n); if (v >= pwd->nb_block_sizes) return -E_WMA_BLOCK_SIZE; @@ -1129,7 +1129,7 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, if (len > 0) skip_bits(&pwd->gb, len); - pwd->reset_block_lengths = 1; + pwd->reset_block_lengths = true; for (i = 0; i < nb_frames; i++) { ret = wma_decode_frame(pwd, samples); if (ret < 0)