mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
mciqtz32: Use opened state to avoid device to be closed several times.
This commit is contained in:
parent
de4f3dc8e8
commit
1506e22663
@ -185,6 +185,8 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wma->opened = TRUE;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
@ -215,14 +217,12 @@ static DWORD MCIQTZ_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
|
|||||||
if (!wma)
|
if (!wma)
|
||||||
return MCIERR_INVALID_DEVICE_ID;
|
return MCIERR_INVALID_DEVICE_ID;
|
||||||
|
|
||||||
if (wma->pgraph)
|
if (wma->opened) {
|
||||||
IGraphBuilder_Release(wma->pgraph);
|
IGraphBuilder_Release(wma->pgraph);
|
||||||
wma->pgraph = NULL;
|
|
||||||
if (wma->pmctrl)
|
|
||||||
IMediaControl_Release(wma->pmctrl);
|
IMediaControl_Release(wma->pmctrl);
|
||||||
wma->pmctrl = NULL;
|
CoUninitialize();
|
||||||
|
wma->opened = FALSE;
|
||||||
CoUninitialize();
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MCIDEVICEID wDevID;
|
MCIDEVICEID wDevID;
|
||||||
|
BOOL opened;
|
||||||
IGraphBuilder* pgraph;
|
IGraphBuilder* pgraph;
|
||||||
IMediaControl* pmctrl;
|
IMediaControl* pmctrl;
|
||||||
BOOL started;
|
BOOL started;
|
||||||
|
Loading…
Reference in New Issue
Block a user