[alsa-devel] [PATCH - AAF PCM plugin 3/7] aaf: Implement Playback mode support

Guedes, Andre andre.guedes at intel.com
Wed Oct 10 23:27:29 CEST 2018


On Wed, 2018-10-10 at 12:34 +0200, Takashi Iwai wrote:
> > +static int aaf_set_hw_constraint(snd_pcm_aaf_t *aaf)
> > +{
> > +     int res;
> > +     snd_pcm_ioplug_t *io = &aaf->io;
> > +     const unsigned int accesses[] = {
> > +             SND_PCM_ACCESS_RW_INTERLEAVED,
> > +     };
> > +     const unsigned int formats[] = {
> > +             SND_PCM_FORMAT_S16_BE,
> > +             SND_PCM_FORMAT_S24_3BE,
> > +             SND_PCM_FORMAT_S32_BE,
> > +             SND_PCM_FORMAT_FLOAT_BE,
> > +     };
> > +     const unsigned int rates[] = {
> > +             8000,
> > +             16000,
> > +             24000,
> > +             32000,
> > +             44100,
> > +             48000,
> > +             88200,
> > +             96000,
> > +             176400,
> > +             192000,
> > +     };
> 
> Use static arrays for the above.

It isn't clear to me what is the point in allocating these variables in
the global scope. May I ask what is the benefit in adding the 'static'
modifier to these local variables?

Thanks,

Andre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3262 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20181010/f6ca7419/attachment.bin>


More information about the Alsa-devel mailing list