diff options
author | Chris Robinson <[email protected]> | 2008-02-13 19:34:47 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-02-13 19:34:47 -0800 |
commit | d523b440e3f6211e59f7f4e8f3c752ff6942b664 (patch) | |
tree | c67217a750f97053a947e02a916dd79389b0b26c /Alc/alsa.c | |
parent | f2875d5d13c1d37c0602d49e49699b4b0a48ddd5 (diff) |
Wait for a PCM handle to be ready for more data instead of polling every 1ms or so
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r-- | Alc/alsa.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -73,6 +73,7 @@ MAKE_FUNC(snd_pcm_hw_params); MAKE_FUNC(snd_pcm_prepare); MAKE_FUNC(snd_pcm_start); MAKE_FUNC(snd_pcm_resume); +MAKE_FUNC(snd_pcm_wait); MAKE_FUNC(snd_pcm_state); MAKE_FUNC(snd_pcm_avail_update); MAKE_FUNC(snd_pcm_areas_silence); @@ -185,7 +186,8 @@ static ALuint ALSAProc(ALvoid *ptr) break; } } - Sleep(1); + else if(psnd_pcm_wait(data->pcmHandle, 1000) == 0) + AL_PRINT("Wait timeout... buffer size too low?\n"); continue; } @@ -747,6 +749,7 @@ LOAD_FUNC(snd_pcm_hw_params); LOAD_FUNC(snd_pcm_prepare); LOAD_FUNC(snd_pcm_start); LOAD_FUNC(snd_pcm_resume); +LOAD_FUNC(snd_pcm_wait); LOAD_FUNC(snd_pcm_state); LOAD_FUNC(snd_pcm_avail_update); LOAD_FUNC(snd_pcm_areas_silence); |