From 9b7490635d6301f45380d0f979ac4f0f74920437 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Sat, 17 Oct 2009 16:40:28 +0200 Subject: [PATCH] mciwave: Do not transition via Resume from Record into Play. --- dlls/mciwave/mciwave.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index 664cc44..de78287 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -726,18 +726,18 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - wmw->fInput = FALSE; - if (wmw->hFile == 0) { WARN("Can't play: no file=%s!\n", debugstr_w(wmw->openParms.lpstrElementName)); return MCIERR_FILE_NOT_FOUND; } - if (wmw->dwStatus == MCI_MODE_PAUSE) { + if (wmw->dwStatus == MCI_MODE_PAUSE && !wmw->fInput) { /* FIXME: parameters (start/end) in lpParams may not be used */ return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms); } + wmw->fInput = FALSE; + /** This function will be called again by a thread when async is used. * We have to set MCI_MODE_PLAY before we do this so that the app can spin * on MCI_STATUS, so we have to allow it here if we're not going to start this thread. @@ -972,16 +972,16 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + if (wmw->dwStatus == MCI_MODE_PAUSE && wmw->fInput) { + /* FIXME: parameters (start/end) in lpParams may not be used */ + return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms); + } + /* FIXME : since there is no way to determine in which mode the device is * open (recording/playback) automatically switch from a mode to another */ wmw->fInput = TRUE; - if (wmw->dwStatus == MCI_MODE_PAUSE) { - /* FIXME: parameters (start/end) in lpParams may not be used */ - return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms); - } - /** This function will be called again by a thread when async is used. * We have to set MCI_MODE_PLAY before we do this so that the app can spin * on MCI_STATUS, so we have to allow it here if we're not going to start this thread. -- 1.5.6.3