From 2cec4f458afd35fdc74de56a57d3c8d13bd8c409 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 26 Jul 2005 10:31:11 +0000 Subject: [PATCH] wait_for_poll can go into an infinite loop. Remove it and replace it with snd_pcm_drain which is more likely to do what the original author intended. --- dlls/winmm/winealsa/audio.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/dlls/winmm/winealsa/audio.c b/dlls/winmm/winealsa/audio.c index 5228edc166a..fe4a7e58b58 100644 --- a/dlls/winmm/winealsa/audio.c +++ b/dlls/winmm/winealsa/audio.c @@ -2051,26 +2051,6 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEDEV* wwo, BOOL force) } -static void wait_for_poll(snd_pcm_t *handle, struct pollfd *ufds, unsigned int count) -{ - unsigned short revents; - - if (snd_pcm_state(handle) != SND_PCM_STATE_RUNNING) - return; - - while (1) { - poll(ufds, count, -1); - snd_pcm_poll_descriptors_revents(handle, ufds, count, &revents); - - if (revents & POLLERR) - return; - - /*if (revents & POLLOUT) - return 0;*/ - } -} - - /************************************************************************** * wodPlayer_Reset [internal] * @@ -2085,7 +2065,7 @@ static void wodPlayer_Reset(WINE_WAVEDEV* wwo) TRACE("(%p)\n", wwo); /* flush all possible output */ - wait_for_poll(wwo->pcm, wwo->ufds, wwo->count); + snd_pcm_drain(wwo->pcm); wodUpdatePlayedTotal(wwo, NULL); /* updates current notify list */