Commit 22569e6d authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

mciavi: Prevent deadlock when closing while playing or when paused.

parent 52ebbb8a
......@@ -89,6 +89,7 @@ static DWORD MCIAVI_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
wma->hStopEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wma->wDevID = modp->wDeviceID;
wma->wCommandTable = mciLoadCommandResource(MCIAVI_hInstance, mciAviWStr, 0);
wma->dwStatus = MCI_MODE_NOT_READY;
modp->wCustomCommandTable = wma->wCommandTable;
modp->wType = MCI_DEVTYPE_DIGITAL_VIDEO;
mciSetDriverData(wma->wDevID, (DWORD_PTR)wma);
......@@ -301,11 +302,11 @@ DWORD MCIAVI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
wma = MCIAVI_mciGetOpenDev(wDevID);
if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
EnterCriticalSection(&wma->cs);
if (wma->nUseCount == 1) {
if (wma->dwStatus != MCI_MODE_STOP)
dwRet = MCIAVI_mciStop(wDevID, MCI_WAIT, NULL);
MCIAVI_CleanUp(wma);
if ((dwFlags & MCI_NOTIFY) && lpParms) {
......
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