In DeviceInfoDS free the frame duration list after use
Per the docs, the caller is responsible for freeing the memory. Bug: chromium:1441804 Change-Id: I9aaae493a1a86d8ab4f03930715a643a3c9fb61b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304061 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39983}
This commit is contained in:
parent
6fc1ae58be
commit
adf55790b6
@ -454,11 +454,18 @@ int32_t DeviceInfoDS::CreateCapabilityMap(const char* deviceUniqueIdUTF8)
|
||||
hrVC = videoControlConfig->GetFrameRateList(
|
||||
outputCapturePin, tmp, size, &listSize, &frameDurationList);
|
||||
|
||||
if (hrVC == S_OK) {
|
||||
maxFPS = GetMaxOfFrameArray(frameDurationList, listSize);
|
||||
}
|
||||
|
||||
CoTaskMemFree(frameDurationList);
|
||||
frameDurationList = NULL;
|
||||
listSize = 0;
|
||||
|
||||
// On some odd cameras, you may get a 0 for duration. Some others may
|
||||
// not update the out vars. GetMaxOfFrameArray returns the lowest
|
||||
// duration (highest FPS), or 0 if there was no list with elements.
|
||||
if (hrVC == S_OK &&
|
||||
0 != (maxFPS = GetMaxOfFrameArray(frameDurationList, listSize))) {
|
||||
if (0 != maxFPS) {
|
||||
capability.maxFPS = static_cast<int>(10000000 / maxFPS);
|
||||
capability.supportFrameRateControl = true;
|
||||
} else // use existing method
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user