[FFmpeg-devel] [PATCH v2 4/6] avcodec/adpcm_swf: support custom block size for encoding

Zane van Iperen zane at zanevaniperen.com
Tue Oct 20 01:44:49 EEST 2020


Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>
---
 libavcodec/adpcmenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 5b485e7d26..42b83c2b48 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -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:
-- 
2.28.0




More information about the ffmpeg-devel mailing list