]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/adpcm_ima_wav: support custom block size for encoding
authorZane van Iperen <zane@zanevaniperen.com>
Wed, 14 Oct 2020 12:43:34 +0000 (22:43 +1000)
committerZane van Iperen <zane@zanevaniperen.com>
Fri, 16 Oct 2020 23:36:06 +0000 (09:36 +1000)
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
libavcodec/adpcmenc.c

index 6c07142a65aa191d1777ea0cac4cfec7ec8966e7..725d418edc49edd4c44dc03e764f4aa0d06d957a 100644 (file)
@@ -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: