Commit 1506e226 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

mciqtz32: Use opened state to avoid device to be closed several times.

parent de4f3dc8
......@@ -185,6 +185,8 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
goto err;
}
wma->opened = TRUE;
return 0;
err:
......@@ -215,14 +217,12 @@ static DWORD MCIQTZ_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
if (!wma)
return MCIERR_INVALID_DEVICE_ID;
if (wma->pgraph)
if (wma->opened) {
IGraphBuilder_Release(wma->pgraph);
wma->pgraph = NULL;
if (wma->pmctrl)
IMediaControl_Release(wma->pmctrl);
wma->pmctrl = NULL;
CoUninitialize();
CoUninitialize();
wma->opened = FALSE;
}
return 0;
}
......
......@@ -27,6 +27,7 @@
typedef struct {
MCIDEVICEID wDevID;
BOOL opened;
IGraphBuilder* pgraph;
IMediaControl* pmctrl;
BOOL started;
......
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