aboutsummaryrefslogtreecommitdiff
path: root/audio/decoders/qdm2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'audio/decoders/qdm2.cpp')
-rw-r--r--audio/decoders/qdm2.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp
index 0388450bd2..749a0d64dd 100644
--- a/audio/decoders/qdm2.cpp
+++ b/audio/decoders/qdm2.cpp
@@ -1225,35 +1225,22 @@ void ff_mpa_synth_filter(int16 *synth_buf_ptr, int *synth_buf_offset,
* = (max_vlc_length + bits - 1) / bits
*/
static int getVlc2(Common::BitStream *s, int16 (*table)[2], int bits, int maxDepth) {
- int totalBits = 0;
- int index;
- int code;
- int n;
-
- index = s->peekBits(bits);
- code = table[index][0];
- n = table[index][1];
+ int index = s->getBits(bits);
+ int code = table[index][0];
+ int n = table[index][1];
if (maxDepth > 1 && n < 0) {
- totalBits += bits;
- s->skip(bits);
-
- index = s->peekBits(-n) + code;
+ index = s->getBits(-n) + code;
code = table[index][0];
n = table[index][1];
if(maxDepth > 2 && n < 0) {
- totalBits += -n;
- s->skip(-n);
-
- index = s->peekBits(-n) + code;
+ index = s->getBits(-n) + code;
code = table[index][0];
n = table[index][1];
}
}
- s->skip(totalBits + n);
-
return code;
}