From f0f0a4f5bd18657456885284c00f4bfce91007b7 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 23 Apr 2019 16:04:55 +0300 Subject: lib/igt_alsa: use variables to improve readability 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 Reviewed-by: Martin Peres --- 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); } -- cgit v1.2.3