Check that we are still playing in wodUpdatePlayedTotal(). If not,

then the value returned by snd_pcm_delay() is not usable so assume
delay=0. This gets the winmm test to complete in interactive mode with
winealsa.
This commit is contained in:
Francois Gouget 2004-07-19 21:20:59 +00:00 committed by Alexandre Julliard
parent cc3a95c6e9
commit 2e13bf774e
1 changed files with 6 additions and 4 deletions

View File

@ -998,10 +998,12 @@ static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD
*/
static BOOL wodUpdatePlayedTotal(WINE_WAVEOUT* wwo, snd_pcm_status_t* ps)
{
snd_pcm_sframes_t delay = 0;
snd_pcm_delay(wwo->p_handle, &delay);
wwo->dwPlayedTotal = wwo->dwWrittenTotal - snd_pcm_frames_to_bytes(wwo->p_handle, delay);
return TRUE;
snd_pcm_sframes_t delay = 0;
snd_pcm_delay(wwo->p_handle, &delay);
if (snd_pcm_state(wwo->p_handle) != SND_PCM_STATE_RUNNING)
delay=0;
wwo->dwPlayedTotal = wwo->dwWrittenTotal - snd_pcm_frames_to_bytes(wwo->p_handle, delay);
return TRUE;
}
/**************************************************************************