diff --git a/libavcodec/aptx.c b/libavcodec/aptx.c index 8e110acc97..ed814ad1c0 100644 --- a/libavcodec/aptx.c +++ b/libavcodec/aptx.c @@ -516,15 +516,6 @@ av_cold int ff_aptx_init(AVCodecContext *avctx) s->hd = avctx->codec->id == AV_CODEC_ID_APTX_HD; s->block_size = s->hd ? 6 : 4; - if (avctx->frame_size == 0) - avctx->frame_size = 256 * s->block_size; - - if (avctx->frame_size % s->block_size) { - av_log(avctx, AV_LOG_ERROR, - "Frame size must be a multiple of %d samples\n", s->block_size); - return AVERROR(EINVAL); - } - for (chan = 0; chan < NB_CHANNELS; chan++) { Channel *channel = &s->channels[chan]; for (subband = 0; subband < NB_SUBBANDS; subband++) { diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index f9347853d2..434a9abf0f 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -257,6 +257,9 @@ static av_cold int aptx_encode_init(AVCodecContext *avctx) ff_af_queue_init(avctx, &s->afq); + if (!avctx->frame_size || avctx->frame_size % 4) + avctx->frame_size = 1024; + return ff_aptx_init(avctx); }