diff options
author | Chris Robinson <[email protected]> | 2015-11-23 16:50:31 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-11-23 16:50:31 -0800 |
commit | 63567526b0a17449baf57053d11688aa277a7e40 (patch) | |
tree | 75218b1ed7774365251b86e15146328802248075 | |
parent | c8a3e51296d367990b9603a8e53f24dd1068b23d (diff) |
Better handle inexact ALSA period counts
-rw-r--r-- | Alc/backends/alsa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 955fd8c0..43c46484 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; |