aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-14 12:59:44 -0800
committerChris Robinson <[email protected]>2008-01-14 12:59:44 -0800
commita27b855a398f6f6c639eed2990e723cca13e3497 (patch)
treed5ed2028dfc373605eda6b2a9732e4269b5717eb /Alc/alsa.c
parent1634b69faf895e2666f81af344aad76609cfbc60 (diff)
Make sure the stream is playing when it's full
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 19bda047..79092675 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -173,6 +173,19 @@ static ALuint ALSAProc(ALvoid *ptr)
// make sure there's frames to process
if(avail == 0)
{
+ if(state != SND_PCM_STATE_RUNNING)
+ {
+ err = psnd_pcm_start(data->pcmHandle);
+ if(err < 0)
+ {
+ err = xrun_recovery(data->pcmHandle, err);
+ if (err < 0)
+ {
+ AL_PRINT("start failed: %s\n", psnd_strerror(err));
+ break;
+ }
+ }
+ }
Sleep(1);
continue;
}