[FFmpeg-devel] [PATCH] RealAudio 14.4K encoder

Justin Ruggles justin.ruggles
Thu May 13 00:33:18 CEST 2010


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.

-Justin



More information about the ffmpeg-devel mailing list