diff options
author | Zane van Iperen <zane@zanevaniperen.com> | 2020-10-14 22:21:30 +1000 |
---|---|---|
committer | Zane van Iperen <zane@zanevaniperen.com> | 2020-10-17 09:36:05 +1000 |
commit | bd1c94bb6801e06b2fce9238df67bd1de4a90ace (patch) | |
tree | f2a060f5f152a09b8dd6f2cb674ab5506d534e3f /libavcodec/adpcmenc.c | |
parent | c78c60c3e8b3d8f5e3b27f9c8fd2481a2e7273ab (diff) | |
download | ffmpeg-bd1c94bb6801e06b2fce9238df67bd1de4a90ace.tar.gz |
avcodec/adpcm_ms: support custom block size for encoding
Fixes tickets #6585 and #7109
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r-- | libavcodec/adpcmenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 1ca74abc82..df5a7333cb 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -127,9 +127,9 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) case AV_CODEC_ID_ADPCM_MS: /* each 16 bits sample gives one nibble and we have 7 bytes per channel overhead */ - avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; + avctx->frame_size = (s->block_size - 7 * avctx->channels) * 2 / avctx->channels + 2; avctx->bits_per_coded_sample = 4; - avctx->block_align = BLKSIZE; + avctx->block_align = s->block_size; if (!(avctx->extradata = av_malloc(32 + AV_INPUT_BUFFER_PADDING_SIZE))) return AVERROR(ENOMEM); avctx->extradata_size = 32; |