[igt-dev] [PATCH i-g-t v7 4/8] lib/igt_alsa: use variables to improve readability

Simon Ser
2019-04-23T13:04:54Z

Most people don't have "remember what the last two parameters of
snd_pcm_set_params are" in their lifegoals list. Use variables so that it's
clearer what those are.

Signed-off-by: Simon Ser <simon.ser@intel.com>
---
lib/igt_alsa.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/igt_alsa.c b/lib/igt_alsa.c
index 3b1a9e90..a478686a 100644
--- a/lib/igt_alsa.c
+++ b/lib/igt_alsa.c
@@ -426,13 +426,16 @@ void alsa_configure_output(struct alsa *alsa, int channels,
snd_pcm_t *handle;
int ret;
int i;
+ int soft_resample = 0; /* Don't allow ALSA to resample */
+ unsigned int latency = 0;

for (i = 0; i < alsa->output_handles_count; i++) {
handle = alsa->output_handles[i];

ret = snd_pcm_set_params(handle, SND_PCM_FORMAT_S16_LE,
SND_PCM_ACCESS_RW_INTERLEAVED,
- channels, sampling_rate, 0, 0);
+ channels, sampling_rate,
+ soft_resample, latency);
igt_assert(ret >= 0);
}