summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-10-14 22:43:34 +1000
committerZane van Iperen <zane@zanevaniperen.com>2020-10-17 09:36:06 +1000
commite368be52303df72d152f0a0cb54672fe3c0834a9 (patch)
treea36cc4cfa6846eca8aa35c563876d001dde86ad2 /libavcodec
parented1cfb8e318e052aa1b096c48a12c656b3df9521 (diff)
avcodec/adpcm_ima_wav: support custom block size for encoding
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcmenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 6c07142a65..725d418edc 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -113,11 +113,11 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
case AV_CODEC_ID_ADPCM_IMA_WAV:
/* each 16 bits sample gives one nibble
and we have 4 bytes per channel overhead */
- avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 /
+ avctx->frame_size = (s->block_size - 4 * avctx->channels) * 8 /
(4 * avctx->channels) + 1;
/* seems frame_size isn't taken into account...
have to buffer the samples :-( */
- avctx->block_align = BLKSIZE;
+ avctx->block_align = s->block_size;
avctx->bits_per_coded_sample = 4;
break;
case AV_CODEC_ID_ADPCM_IMA_QT: