From bb36bb4bbe1ee01fb95debdca79d9769851a06da Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 11 Sep 2009 01:21:46 +0200 Subject: [PATCH] alsa: properly convert sample buffer sizes --- src/modules/alsa/alsa-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index f934285..56d60df 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -275,11 +275,11 @@ int pa_alsa_set_hw_params( } if (_use_tsched && tsched_size > 0) { - _buffer_size = pa_convert_size(tsched_size, ss, &_ss); + _buffer_size = (snd_pcm_uframes_t) (((uint64_t) tsched_size * _ss.rate) / ss->rate); _period_size = _buffer_size; } else { - _period_size = pa_convert_size(_period_size, ss, &_ss); - _buffer_size = pa_convert_size(_buffer_size, ss, &_ss); + _period_size = (snd_pcm_uframes_t) (((uint64_t) _period_size * _ss.rate) / ss->rate); + _buffer_size = (snd_pcm_uframes_t) (((uint64_t) _buffer_size * _ss.rate) / ss->rate); } if (_buffer_size > 0 || _period_size > 0) { -- 2.7.4