[FFmpeg-devel] [PATCH 2/7] avcodec/adpcm_ms: support variable block size for encoding
Zane van Iperen
zane at zanevaniperen.com
Wed Oct 14 16:09:48 EEST 2020
Fixes tickets #6585 and #7109
Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>
---
libavcodec/adpcmenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 0038a10830..fc29bf8571 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;
--
2.25.4
More information about the ffmpeg-devel
mailing list