winealsa.drv: Add ability to recover from underruns to directsound driver.

Fixes handling of buffer underruns that might still occur.
oldstable
Maarten Lankhorst 2008-08-08 20:50:02 +02:00 committed by Alexandre Julliard
parent 80c6099b2c
commit 2cd620802a
1 changed files with 7 additions and 1 deletions

View File

@ -548,7 +548,13 @@ static HRESULT WINAPI IDsDriverBufferImpl_GetPosition(PIDSDRIVERBUFFER iface,
}
if (state == SND_PCM_STATE_RUNNING)
{
snd_pcm_uframes_t used = This->mmap_buflen_frames - snd_pcm_avail_update(This->pcm);
snd_pcm_sframes_t used = This->mmap_buflen_frames - snd_pcm_avail_update(This->pcm);
if (used < 0)
{
snd_pcm_forward(This->pcm, -used);
used = 0;
}
if (This->mmap_pos > used)
hw_pptr = This->mmap_pos - used;