From Mark Sciabica, "It's not Windows API calls that are causing the problem. It's a new

templated constructor of std::pair not being able to automatically
convert 0 to a pointer. Rather than use preprocessor checks and
#defines, I think a cleaner solution is to cast the std::pair arguments
to the appropriate types to help the compiler out. I attached an updated
version of the file implementing this."
This commit is contained in:
Robert Osfield
2010-11-11 10:42:41 +00:00
parent 68f37c4dcb
commit a80c458285

View File

@@ -997,13 +997,15 @@ struct ListCapDeviceAvailable
filterFrameRate.insert(std::pair<double, CapEntry>(error, filterResolution[i]));
}
CapEntry best = CapEntry(0,0);
CapEntry first = CapEntry(0,0);
CapEntry nullCapEntry(static_cast<AM_MEDIA_TYPE*>(NULL), static_cast<VIDEOINFOHEADER*>(NULL));
CapEntry best = nullCapEntry;
CapEntry first = nullCapEntry;
for (ContainerFrameRateSorted::iterator it = filterFrameRate.begin();
it != filterFrameRate.end();
++it)
{
if (first == CapEntry(0,0))
if (first == nullCapEntry)
first = it->second;
if (it->first < 1e-3)
@@ -1015,14 +1017,14 @@ struct ListCapDeviceAvailable
best = it->second;
}
}
if (best != CapEntry(0,0))
if (best != nullCapEntry)
return best;
if (first != CapEntry(0,0))
if (first != nullCapEntry)
return first;
if (!_capsList.empty())
return _capsList.front();
return CapEntry(0,0);
return nullCapEntry;
}
void createList()