File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,11 @@ static const char* detectCpuTemp(double* current)
4242
4343const char * ffDetectCPUImpl (const FFCPUOptions * options , FFCPUResult * cpu )
4444{
45- if (ffSysctlGetString ("machdep.cpu_brand" , & cpu -> name ) != NULL )
45+ if (ffSysctlGetString ("machdep.cpu_brand" , & cpu -> name ) != NULL &&
46+ ffSysctlGetString ("machdep.dmi.processor-version" , & cpu -> name ) != NULL &&
47+ ffSysctlGetString ("hw.cpu0.name" , & cpu -> name ) != NULL )
4648 {
47- if (ffSysctlGetString ("machdep.dmi.processor-version" , & cpu -> name ) != NULL )
48- return "sysctlbyname(machdep.cpu_brand) failed" ;
49+ ffStrbufSetS (& cpu -> name , "Unknown CPU" );
4950 }
5051
5152 if (ffSysctlGetString ("machdep.dmi.processor-vendor" , & cpu -> vendor ) == NULL )
@@ -58,6 +59,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
5859 ffCPUDetectSpeedByCpuid (cpu );
5960
6061 uint32_t freq = (uint32_t ) ffSysctlGetInt ("machdep.cpu.frequency.target" , 0 );
62+ if (freq == 0 ) freq = (uint32_t ) (ffSysctlGetInt64 ("hw.cpu0.clock_frequency" , 0 ) / 1000000 );
6163 if (freq > cpu -> frequencyBase ) cpu -> frequencyBase = freq ;
6264
6365 cpu -> temperature = FF_CPU_TEMP_UNSET ;
You can’t perform that action at this time.
0 commit comments