From 7af6e01ace4486ec929c55425fa5525d22bc2cbd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 12 May 2006 18:07:07 +0200 Subject: [PATCH] Fix the default buffer size calculation in speaker-test Fixed the default buffer size calculation in speaker-test. The size should be aligned to nperiods. --- speaker-test/speaker-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c index 94eccd9..9a7bf3c 100644 --- a/speaker-test/speaker-test.c +++ b/speaker-test/speaker-test.c @@ -342,6 +342,8 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_ } if (! buffer_time && ! period_time) { buffer_size = buffer_size_max; + if (! period_time) + buffer_size = (buffer_size / nperiods) * nperiods; printf(_("Using max buffer size %lu\n"), buffer_size); err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &buffer_size); if (err < 0) {