Commit 2cd62080 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

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

Fixes handling of buffer underruns that might still occur.
parent 80c6099b
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment