We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 256c9be commit 4cabc56Copy full SHA for 4cabc56
src/modules/cpuusage/cpuusage.c
@@ -22,7 +22,7 @@ void ffPrintCPUUsage(FFCPUUsageOptions* options)
22
double maxValue = -999, minValue = 999, sumValue = 0;
23
uint32_t maxIndex = 999, minIndex = 999;
24
25
- uint32_t index = 0;
+ uint32_t index = 0, valueCount = 0;
26
FF_LIST_FOR_EACH(double, percent, percentages)
27
{
28
if (*percent == *percent)
@@ -38,10 +38,11 @@ void ffPrintCPUUsage(FFCPUUsageOptions* options)
38
minValue = *percent;
39
minIndex = index;
40
}
41
+ ++valueCount;
42
43
++index;
44
- double avgValue = sumValue / (double) percentages.length;
45
+ double avgValue = sumValue / (double) valueCount;
46
47
if(options->moduleArgs.outputFormat.length == 0)
48
0 commit comments