[FFmpeg-devel] [PATCH] RealAudio 14.4K encoder
Francesco Lavra
francescolavra
Fri May 14 20:30:16 CEST 2010
On Wed, 2010-05-12 at 18:33 -0400, Justin Ruggles wrote:
> Francesco Lavra wrote:
>
> > On Wed, 2010-05-05 at 18:26 +0200, Michael Niedermayer wrote:
> >> On Sun, May 02, 2010 at 08:06:47PM +0200, Francesco Lavra wrote:
> >>> Hi,
> >> [...]
> >>> + if (avctx->frame_size > 0) {
> >>> + if (avctx->frame_size != NBLOCKS * BLOCKSIZE) {
> >>> + av_log(avctx, AV_LOG_ERROR, "invalid block size: %d\n",
> >>> + avctx->frame_size);
> >>> + return -1;
> >>> + }
> >>> + } else {
> >>> + avctx->frame_size = NBLOCKS * BLOCKSIZE;
> >>> + }
> >> is this complexity needed?
> >
> > I took that piece of code from flacenc.c, but it seems I chose the worst
> > file to copy from, since that check on avctx->frame_size is not done
> > anywhere else. Removed.
>
> The FLAC encoder does this because the user can specify their preferred
> frame size by setting it to a non-zero value, but only within the bounds
> allowed by FLAC. If your encoder will not allow the user to choose the
> frame size, you don't need those checks.
Ok, thanks for your explanation. The RealAudio encoder has a fixed frame
size, so I don't need these checks.
Francesco
More information about the ffmpeg-devel
mailing list