From 59227d6b80ff74f3252422429dd66247fe8098bc Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 15 Dec 2002 02:59:13 +0000 Subject: [PATCH] Fixed hangup condition at the end of some playback. --- dlls/winmm/wineoss/audio.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/winmm/wineoss/audio.c b/dlls/winmm/wineoss/audio.c index 59553af0976..ee0becff6b5 100644 --- a/dlls/winmm/wineoss/audio.c +++ b/dlls/winmm/wineoss/audio.c @@ -1152,8 +1152,12 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEOUT* wwo) TRACE("fragments=%d/%d, fragsize=%d, bytes=%d\n", dspspace.fragments, dspspace.fragstotal, dspspace.fragsize, dspspace.bytes); - /* input queue empty and output buffer with less than one fragment to play */ - if (!wwo->lpPlayPtr && wwo->dwBufferSize < availInQ + wwo->dwFragmentSize) { + /* input queue empty and output buffer with less than one fragment to play + * actually some cards do not play the fragment before the last if this one is partially feed + * so we need to test for full the availability of 2 fragments + */ + if (!wwo->lpPlayPtr && wwo->dwBufferSize < availInQ + 2 * wwo->dwFragmentSize && + !wwo->bNeedPost) { TRACE("Run out of wavehdr:s...\n"); return INFINITE; } @@ -1221,8 +1225,8 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt) TRACE("flushing\n"); ioctl(wwo->ossdev->fd, SNDCTL_DSP_SYNC, 0); wwo->dwPlayedTotal = wwo->dwWrittenTotal; - } - else { + dwNextNotifyTime = wodPlayer_NotifyCompletions(wwo, FALSE); + } else { TRACE("recovering\n"); dwNextFeedTime = wodPlayer_FeedDSP(wwo); }