Skip to content

Commit

Permalink
Better handle inexact ALSA period counts
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Nov 24, 2015
1 parent c8a3e51 commit 6356752
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Alc/backends/alsa.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6356752

Please sign in to comment.