[FFmpeg-cvslog] af_pan: comment a tricky piece of code.

Clément Bœsch ubitux at gmail.com
Wed Feb 15 20:32:11 CET 2012


On Wed, Feb 15, 2012 at 08:23:41PM +0100, Reimar Döffinger wrote:
> On Wed, Feb 15, 2012 at 08:12:36PM +0100, Nicolas George wrote:
> > +        /* reject layouts that are not a single channel */
> >          if (channel_id >= MAX_CHANNELS || layout0 != (int64_t)1 << channel_id)
> 
> If we ever used all 64 bits, (int64_t)1 << channel_id would actually be
> a signed overflow.
> Also 1ull is generally accepted as a shorthand I think (even though
> the more proper one is UINT64_C(1) ).

IIRC, Måns started to make the channel layouts unsigned all over the place
a while ago. I'm not sure we want to do that actually. We will need to
replace the channel layouts -1 into ~0 (or similar), change quite a bunch
of public prototypes (though, it should not really break API/ABI), and
yes, also change the shift into 1ULL<<x or UINT64_C(1)<<x in a few places.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20120215/0d995d49/attachment.asc>


More information about the ffmpeg-cvslog mailing list