Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2021-05-03 14:20:26 +0300
committerZane van Iperen <zane@zanevaniperen.com>2021-05-12 13:25:21 +0300
commita845e6daa9aba4cbed024de8cbefccaa6c40f4bb (patch)
tree543760899e50da1642b0ca1b8e2225f1ea8d789b /libavcodec/adpcm.c
parent175f675f7bf1065f02bfbc676f081e369027bce5 (diff)
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>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 8fe43b5720..09ea062027 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -2008,14 +2008,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
for (n = 0; n < 28; n++) {
int sample = 0, scale;
- if (flag < 0x07) {
- if (n & 1) {
- scale = sign_extend(byte >> 4, 4);
- } else {
- byte = bytestream2_get_byteu(&gb);
- scale = sign_extend(byte, 4);
- }
+ if (n & 1) {
+ scale = sign_extend(byte >> 4, 4);
+ } else {
+ byte = bytestream2_get_byteu(&gb);
+ scale = sign_extend(byte, 4);
+ }
+ if (flag < 0x07) {
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);
}