diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-02-06 18:07:35 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-02-06 18:09:11 +0100 |
commit | 64b242d03078630bbe7570d0775d3a68f166306c (patch) | |
tree | 34133493160c5801be7f18272b76a123c8d7cb2e /libavcodec | |
parent | d7c2da1f8d14672ff0768305b87cf118ad320469 (diff) | |
download | ffmpeg-64b242d03078630bbe7570d0775d3a68f166306c.tar.gz |
avcodec/wavarc: fix 8bit decoding
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wavarc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/wavarc.c b/libavcodec/wavarc.c index caab08cb24..b18a88000b 100644 --- a/libavcodec/wavarc.c +++ b/libavcodec/wavarc.c @@ -68,9 +68,9 @@ static av_cold int wavarc_init(AVCodecContext *avctx) av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx->extradata + 38)); avctx->sample_rate = AV_RL32(avctx->extradata + 40); - switch (avctx->extradata[36]) { - case 0: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break; - case 1: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; + switch (AV_RL16(avctx->extradata + 38)) { + case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break; + case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; } s->shift = 0; @@ -411,7 +411,7 @@ fail: const int *src = s->samples[ch] + s->offset; for (int n = 0; n < frame->nb_samples; n++) - dst[n] = src[n] * (1 << s->shift); + dst[n] = src[n] * (1 << s->shift) + 0x80U; } break; case AV_SAMPLE_FMT_S16P: |