Module: wine Branch: master Commit: ee3c8794eaab91fb3a453c394b131ea894cc6e0e URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee3c8794eaab91fb3a453c394b...
Author: Jörg Höhle hoehle@users.sourceforge.net Date: Tue Nov 17 09:59:05 2009 +0100
mciwave: Abort the play loop in case of audio error.
---
dlls/mciwave/mciwave.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index 6d9b39e..456936c 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -876,14 +876,18 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, */ waveHdr[whidx].dwBufferLength = count; waveHdr[whidx].dwFlags &= ~WHDR_DONE; - TRACE("before WODM_WRITE lpWaveHdr=%p dwBufferLength=%u dwBytesRecorded=%u\n", - &waveHdr[whidx], waveHdr[whidx].dwBufferLength, - waveHdr[whidx].dwBytesRecorded); + TRACE("before WODM_WRITE lpWaveHdr=%p dwBufferLength=%u\n", + &waveHdr[whidx], waveHdr[whidx].dwBufferLength); dwRet = waveOutWrite(wmw->hWave, &waveHdr[whidx], sizeof(WAVEHDR)); + if (dwRet) { + ERR("Aborting play loop, WODM_WRITE error %d\n", dwRet); + dwRet = MCIERR_HARDWARE; + break; + } left -= count; wmw->dwPosition += count; TRACE("after WODM_WRITE dwPosition=%u\n", wmw->dwPosition); - + /* InterlockedDecrement if and only if waveOutWrite is successful */ WAVE_mciPlayWaitDone(wmw); whidx ^= 1; } @@ -896,8 +900,6 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, waveOutUnprepareHeader(wmw->hWave, &waveHdr[0], sizeof(WAVEHDR)); waveOutUnprepareHeader(wmw->hWave, &waveHdr[1], sizeof(WAVEHDR));
- dwRet = 0; - cleanUp: if (dwFlags & MCI_NOTIFY) oldcb = InterlockedExchangePointer(&wmw->hCallback, NULL);