avcodec/adpcm_psx: always fetch next byte irregardless of flag

Even though all samples are meant to be zero (if flag == 0x07),
doesn't mean that they aren't there. See No$PSX docs [1].

[1]: https://problemkaputt.de/psx-spx.htm#spuadpcmsamples

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
pull/362/head
Zane van Iperen 4 years ago
parent 175f675f7b
commit a845e6daa9
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5
  1. 14
      libavcodec/adpcm.c

@ -2008,14 +2008,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
for (n = 0; n < 28; n++) { for (n = 0; n < 28; n++) {
int sample = 0, scale; int sample = 0, scale;
if (flag < 0x07) { if (n & 1) {
if (n & 1) { scale = sign_extend(byte >> 4, 4);
scale = sign_extend(byte >> 4, 4); } else {
} else { byte = bytestream2_get_byteu(&gb);
byte = bytestream2_get_byteu(&gb); scale = sign_extend(byte, 4);
scale = sign_extend(byte, 4); }
}
if (flag < 0x07) {
scale = scale * (1 << 12); scale = scale * (1 << 12);
sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64); sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64);
} }

Loading…
Cancel
Save