1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-07 02:16:19 +02:00

avcodec/adpcm_swf: support custom block size for encoding

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
This commit is contained in:
Zane van Iperen 2020-10-17 13:55:51 +10:00
parent 0547fa572b
commit 4919b3c1c4
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5

View File

@ -153,7 +153,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
"22050 or 44100\n"); "22050 or 44100\n");
return AVERROR(EINVAL); 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; avctx->block_align = (2 + avctx->channels * (22 + 4 * (avctx->frame_size - 1)) + 7) / 8;
break; break;
case AV_CODEC_ID_ADPCM_IMA_SSI: case AV_CODEC_ID_ADPCM_IMA_SSI: