Better handle inexact ALSA period counts

This commit is contained in:
Chris Robinson
2015-11-23 16:50:31 -08:00
parent c8a3e51296
commit 63567526b0
+4 -1
View File
@@ -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;