Commit df0dd9ab authored by Ove Kaaven's avatar Ove Kaaven Committed by Alexandre Julliard

Fixed WHDR_DONE race condition.

parent 11ab5b90
...@@ -475,12 +475,12 @@ static void wodPlayer_Notify(WINE_WAVEOUT* wwo, WORD uDevID, BOOL force) ...@@ -475,12 +475,12 @@ static void wodPlayer_Notify(WINE_WAVEOUT* wwo, WORD uDevID, BOOL force)
if (lpWaveHdr->reserved > tc && !force) break; if (lpWaveHdr->reserved > tc && !force) break;
wwo->dwPlayedTotal += lpWaveHdr->dwBufferLength;
wwo->lpQueuePtr = lpWaveHdr->lpNext;
lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
lpWaveHdr->dwFlags |= WHDR_DONE; lpWaveHdr->dwFlags |= WHDR_DONE;
wwo->dwPlayedTotal += lpWaveHdr->dwBufferLength;
wwo->lpQueuePtr = lpWaveHdr->lpNext;
TRACE("Notifying client with %p\n", lpWaveHdr); TRACE("Notifying client with %p\n", lpWaveHdr);
if (OSS_NotifyClient(uDevID, WOM_DONE, (DWORD)lpWaveHdr, 0) != MMSYSERR_NOERROR) { if (OSS_NotifyClient(uDevID, WOM_DONE, (DWORD)lpWaveHdr, 0) != MMSYSERR_NOERROR) {
WARN("can't notify client !\n"); WARN("can't notify client !\n");
...@@ -574,10 +574,6 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt) ...@@ -574,10 +574,6 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt)
case WINE_WM_HEADER: case WINE_WM_HEADER:
lpWaveHdr = (LPWAVEHDR)msg.lParam; lpWaveHdr = (LPWAVEHDR)msg.lParam;
lpWaveHdr->dwFlags &= ~WHDR_DONE;
lpWaveHdr->dwFlags |= WHDR_INQUEUE;
lpWaveHdr->lpNext = 0;
/* insert buffer at the end of queue */ /* insert buffer at the end of queue */
{ {
LPWAVEHDR* wh; LPWAVEHDR* wh;
...@@ -802,6 +798,10 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) ...@@ -802,6 +798,10 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
if (lpWaveHdr->dwFlags & WHDR_INQUEUE) if (lpWaveHdr->dwFlags & WHDR_INQUEUE)
return WAVERR_STILLPLAYING; return WAVERR_STILLPLAYING;
lpWaveHdr->dwFlags &= ~WHDR_DONE;
lpWaveHdr->dwFlags |= WHDR_INQUEUE;
lpWaveHdr->lpNext = 0;
TRACE("imhere[3-HEADER]\n"); TRACE("imhere[3-HEADER]\n");
PostThreadMessageA(WOutDev[wDevID].dwThreadID, WINE_WM_HEADER, 0, (DWORD)lpWaveHdr); PostThreadMessageA(WOutDev[wDevID].dwThreadID, WINE_WM_HEADER, 0, (DWORD)lpWaveHdr);
......
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