[FFmpeg-devel] [PATCH 11/19] 8svx: remove useless rounding code.

Nicolas George nicolas.george at normalesup.org
Sun Jul 29 16:42:57 CEST 2012


Le duodi 12 thermidor, an CCXX, Paul B Mahol a écrit :
> > samples_size and samples_idx are supposed to be multiple of
> > channels at all time. If they are, the division is exact;
> > if they are not, something is very wrong in the code.
> In which case assert would notify us that something got wrong.
> So I would keep assert.

I am not sure I understand you correctly: adding an assert to check that the
division is exact is one of the things this patch does. Do you want that
fact added to the commit message?

> >      /* get output buffer */
> > -    esc->frame.nb_samples = (FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx) +avctx->channels-1)  / avctx->channels;
> > +    av_assert1(!(esc->samples_size % avctx->channels || esc->samples_idx % avctx->channels));
> > +    esc->frame.nb_samples = FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx)  / avctx->channels;
> >      if ((ret = avctx->get_buffer(avctx, &esc->frame)) < 0) {

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120729/daae770e/attachment.asc>


More information about the ffmpeg-devel mailing list