]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/adpcm_swf: support custom block size for encoding
authorZane van Iperen <zane@zanevaniperen.com>
Sat, 17 Oct 2020 03:55:51 +0000 (13:55 +1000)
committerZane van Iperen <zane@zanevaniperen.com>
Wed, 21 Oct 2020 01:26:39 +0000 (11:26 +1000)
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
libavcodec/adpcmenc.c

index 9e0bb831e8eb165e1e7b0b113b9cb474d6206a20..6ecdab96d6d1ab6799b1b3438100c8a8d997979c 100644 (file)
@@ -153,7 +153,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
                    "22050 or 44100\n");
             return AVERROR(EINVAL);
         }
-        avctx->frame_size = 512 * (avctx->sample_rate / 11025);
+        avctx->frame_size  = (s->block_size / 2) * (avctx->sample_rate / 11025);
         avctx->block_align = (2 + avctx->channels * (22 + 4 * (avctx->frame_size - 1)) + 7) / 8;
         break;
     case AV_CODEC_ID_ADPCM_IMA_SSI: