mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Avoid call to params_info if only one format is supported
This commit is contained in:
parent
af3a4199ef
commit
841c8e2909
1 changed files with 7 additions and 4 deletions
|
|
@ -516,10 +516,13 @@ static int snd_pcm_plug_params(snd_pcm_t *pcm, snd_pcm_params_t *params)
|
|||
slave_format->sfmt = slave_fmt;
|
||||
}
|
||||
slave_info.req_mask |= SND_PCM_PARAMS_SFMT;
|
||||
err = snd_pcm_params_info(slave, &slave_info);
|
||||
assert(err >= 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
if (slave_info.formats != 1U << slave_format->sfmt) {
|
||||
err = snd_pcm_params_info(slave, &slave_info);
|
||||
assert(err >= 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (format->channels < slave_info.min_channels)
|
||||
slave_format->channels = slave_info.min_channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue