From 841c8e290950df3dca4d1c54c064c306ea30b4c2 Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Tue, 3 Oct 2000 12:06:45 +0000 Subject: [PATCH] Avoid call to params_info if only one format is supported --- src/pcm/pcm_plug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 61bc9676..61c418d1 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -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; -- 2.47.1