From 3d5ea7dfab00cc52d99f3b4483986b092c66830d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 29 Apr 2020 01:16:23 +0200 Subject: ALSA: set min/max sizes before the debug message --- libs/ardouralsautil/deviceparams.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libs') diff --git a/libs/ardouralsautil/deviceparams.cc b/libs/ardouralsautil/deviceparams.cc index 613eac76e0..05e51201ef 100644 --- a/libs/ardouralsautil/deviceparams.cc +++ b/libs/ardouralsautil/deviceparams.cc @@ -103,6 +103,9 @@ ARDOUR::get_alsa_device_parameters (const char* device_name, const bool play, AL snd_pcm_close (pcm); + nfo->min_size = std::max (min_psiz, min_bufz / nfo->max_nper); + nfo->max_size = std::min (max_psiz, max_bufz / nfo->min_nper); + /* see also libs/backends/alsa/zita-alsa-pcmi.cc * If any debug parameter is set, print device info. */ @@ -121,8 +124,6 @@ ARDOUR::get_alsa_device_parameters (const char* device_name, const bool play, AL fprintf (stdout, " possible : %lu .. %lu\n", nfo->min_size, nfo->max_size); } - nfo->min_size = std::max (min_psiz, min_bufz / nfo->max_nper); - nfo->max_size = std::min (max_psiz, max_bufz / nfo->min_nper); nfo->valid = true; return 0; -- cgit v1.2.3