Module: wine Branch: master Commit: 408abf9a76fbac0d964c4bb7c5f60c1d121b8744 URL: http://source.winehq.org/git/wine.git/?a=commit;h=408abf9a76fbac0d964c4bb7c5... Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Fri Jul 6 15:28:31 2007 +0200 winealsa: Increase performance of waveout getposition. --- dlls/winealsa.drv/waveout.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/dlls/winealsa.drv/waveout.c b/dlls/winealsa.drv/waveout.c index 7004e52..6a01df3 100644 --- a/dlls/winealsa.drv/waveout.c +++ b/dlls/winealsa.drv/waveout.c @@ -109,7 +109,7 @@ static BOOL wodUpdatePlayedTotal(WINE_WAVEDEV* wwo, snd_pcm_status_t* ps) WARN("Unexpected state (%d) or delay (%ld) while updating Total Played, resetting\n", state, delay); delay=0; } - wwo->dwPlayedTotal = wwo->dwWrittenTotal - snd_pcm_frames_to_bytes(wwo->pcm, delay); + InterlockedExchange((LONG*)&wwo->dwPlayedTotal, wwo->dwWrittenTotal - snd_pcm_frames_to_bytes(wwo->pcm, delay)); return TRUE; } @@ -444,10 +444,6 @@ static void wodPlayer_ProcessMessages(WINE_WAVEDEV* wwo) wodPlayer_Reset(wwo,TRUE); SetEvent(ev); break; - case WINE_WM_UPDATE: - wodUpdatePlayedTotal(wwo, NULL); - SetEvent(ev); - break; case WINE_WM_BREAKLOOP: if (wwo->state == WINE_WS_PLAYING && wwo->lpLoopPtr != NULL) { /* ensure exit at end of current loop */ @@ -1013,8 +1009,6 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) if (lpTime == NULL) return MMSYSERR_INVALPARAM; wwo = &WOutDev[wDevID]; - ALSA_AddRingMessage(&wwo->msgRing, WINE_WM_UPDATE, 0, TRUE); - return ALSA_bytes_to_mmtime(lpTime, wwo->dwPlayedTotal, &wwo->format); }