Commit ae6a1f8a authored by aymeric's avatar aymeric
Browse files

Fix missing CoInitialize for detecting camera.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@495 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 9f8e4580
......@@ -1344,10 +1344,14 @@ static void vfw_detect(MSWebCamManager *obj){
ULONG nFetched = 0;
// Initialize COM
CoInitialize(NULL);
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
IID_ICreateDevEnum, (PVOID *)&pCreateDevEnum);
if(FAILED(hr))
{
CoUninitialize();
return ;
}
......@@ -1355,6 +1359,7 @@ static void vfw_detect(MSWebCamManager *obj){
&pEnumMoniker, 0);
if (FAILED(hr) || pEnumMoniker == NULL) {
//printf("no device\n");
CoUninitialize();
return ;
}
......@@ -1394,4 +1399,5 @@ static void vfw_detect(MSWebCamManager *obj){
pEnumMoniker->Release();
pCreateDevEnum->Release();
CoUninitialize();
}
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