From 63567526b0a17449baf57053d11688aa277a7e40 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 23 Nov 2015 16:50:31 -0800 Subject: [PATCH] Better handle inexact ALSA period counts --- Alc/backends/alsa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 955fd8c..43c4648 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -677,6 +677,7 @@ static ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self) unsigned int rate; const char *funcerr; int allowmmap; + int dir; int err; switch(device->FmtType) @@ -787,7 +788,9 @@ static ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self) /* retrieve configuration info */ CHECK(snd_pcm_hw_params_get_access(hp, &access)); CHECK(snd_pcm_hw_params_get_period_size(hp, &periodSizeInFrames, NULL)); - CHECK(snd_pcm_hw_params_get_periods(hp, &periods, NULL)); + CHECK(snd_pcm_hw_params_get_periods(hp, &periods, &dir)); + if(dir != 0) + WARN("Inexact period count: %u (%d)\n", periods, dir); snd_pcm_hw_params_free(hp); hp = NULL; -- 2.6.2