mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 838799: Protect against funky cameras that return 0 FPS r=derf
This commit is contained in:
parent
d11b773ac5
commit
eec106806d
@ -586,7 +586,8 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
||||
|
||||
if (hrVC == S_OK)
|
||||
{
|
||||
LONGLONG *maxFps; // array
|
||||
LONGLONG *frameDurationList;
|
||||
LONGLONG maxFPS;
|
||||
long listSize;
|
||||
SIZE size;
|
||||
size.cx = capability->width;
|
||||
@ -600,11 +601,13 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
||||
hrVC = videoControlConfig->GetFrameRateList(outputCapturePin,
|
||||
tmp, size,
|
||||
&listSize,
|
||||
&maxFps);
|
||||
&frameDurationList);
|
||||
|
||||
if (hrVC == S_OK && listSize > 0)
|
||||
// On some odd cameras, you may get a 0 for duration.
|
||||
// GetMaxOfFrameArray returns the lowest duration (highest FPS)
|
||||
if (hrVC == S_OK && listSize > 0 &&
|
||||
0 != (maxFPS = GetMaxOfFrameArray(frameDurationList, listSize)))
|
||||
{
|
||||
LONGLONG maxFPS = GetMaxOfFrameArray(maxFps, listSize);
|
||||
capability->maxFPS = static_cast<int> (10000000
|
||||
/ maxFPS);
|
||||
capability->supportFrameRateControl = true;
|
||||
|
Loading…
Reference in New Issue
Block a user