winealsa: Stop may not use snd_pcm_drop or lose written frames.

This commit is contained in:
Jörg Höhle 2011-11-15 10:18:39 +01:00 committed by Alexandre Julliard
parent be90732e5e
commit 77e01019c5
1 changed files with 3 additions and 8 deletions

View File

@ -1718,14 +1718,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return S_FALSE;
}
if(snd_pcm_drop(This->pcm_handle) < 0)
WARN("snd_pcm_drop failed\n");
if(snd_pcm_reset(This->pcm_handle) < 0)
WARN("snd_pcm_reset failed\n");
if(snd_pcm_prepare(This->pcm_handle) < 0)
WARN("snd_pcm_prepare failed\n");
/* Stop without losing written frames or position.
* snd_pcm_pause would be appropriate but is unsupported by dmix.
* snd_pcm_drain yields EAGAIN in NONBLOCK mode, except with Pulse. */
event = CreateEventW(NULL, TRUE, FALSE, NULL);
wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event);