CPUUsage: skip NaN when summarizing values

This commit is contained in:
李通洲
2023-11-01 15:49:51 +08:00
parent 1b3d713e50
commit 256c9be19b
+12 -9
View File
@@ -25,16 +25,19 @@ void ffPrintCPUUsage(FFCPUUsageOptions* options)
uint32_t index = 0;
FF_LIST_FOR_EACH(double, percent, percentages)
{
sumValue += *percent;
if (*percent > maxValue)
if (*percent == *percent)
{
maxValue = *percent;
maxIndex = index;
}
if (*percent < minValue)
{
minValue = *percent;
minIndex = index;
sumValue += *percent;
if (*percent > maxValue)
{
maxValue = *percent;
maxIndex = index;
}
if (*percent < minValue)
{
minValue = *percent;
minIndex = index;
}
}
++index;
}