@@ -196,10 +196,6 @@ bool ffPrintGPU(FFGPUOptions* options) {
196196 ++ i ;
197197 }
198198
199- if (selectedGPUs .length == 0 ) {
200- ffPrintError (FF_GPU_MODULE_NAME , 0 , & options -> moduleArgs , FF_PRINT_TYPE_DEFAULT , "No GPUs found" );
201- }
202-
203199 FF_LIST_FOR_EACH (FFGPUResult , gpu , gpus ) {
204200 ffStrbufDestroy (& gpu -> vendor );
205201 ffStrbufDestroy (& gpu -> name );
@@ -208,6 +204,11 @@ bool ffPrintGPU(FFGPUOptions* options) {
208204 ffStrbufDestroy (& gpu -> memoryType );
209205 }
210206
207+ if (selectedGPUs .length == 0 ) {
208+ ffPrintError (FF_GPU_MODULE_NAME , 0 , & options -> moduleArgs , FF_PRINT_TYPE_DEFAULT , (gpus .length > 0 ? "GPUs found but all hidden by hideType option" : "No GPUs detected" ));
209+ return false;
210+ }
211+
211212 return true;
212213}
213214
@@ -230,7 +231,7 @@ void ffParseGPUJsonObject(FFGPUOptions* options, yyjson_val* module) {
230231
231232 if (unsafe_yyjson_equals_str (key , "detectionMethod" )) {
232233 int value ;
233- const char * error = ffJsonConfigParseEnum (val , & value , (FFKeyValuePair []) {
234+ const char * error = ffJsonConfigParseEnum (val , & value , (FFKeyValuePair []){
234235 { "auto" , FF_GPU_DETECTION_METHOD_AUTO },
235236 { "pci" , FF_GPU_DETECTION_METHOD_PCI },
236237 { "vulkan" , FF_GPU_DETECTION_METHOD_VULKAN },
@@ -251,7 +252,7 @@ void ffParseGPUJsonObject(FFGPUOptions* options, yyjson_val* module) {
251252 options -> hideType = FF_GPU_TYPE_NONE ;
252253 } else {
253254 int value ;
254- const char * error = ffJsonConfigParseEnum (val , & value , (FFKeyValuePair []) {
255+ const char * error = ffJsonConfigParseEnum (val , & value , (FFKeyValuePair []){
255256 { "none" , FF_GPU_TYPE_NONE },
256257 { "unknown" , FF_GPU_TYPE_UNKNOWN },
257258 { "integrated" , FF_GPU_TYPE_INTEGRATED },
@@ -445,8 +446,8 @@ void ffInitGPUOptions(FFGPUOptions* options) {
445446 ;
446447 options -> temp = false;
447448 options -> hideType = FF_GPU_TYPE_NONE ;
448- options -> tempConfig = (FFColorRangeConfig ) { 60 , 80 };
449- options -> percent = (FFPercentageModuleConfig ) { 50 , 80 , 0 };
449+ options -> tempConfig = (FFColorRangeConfig ){ 60 , 80 };
450+ options -> percent = (FFPercentageModuleConfig ){ 50 , 80 , 0 };
450451}
451452
452453void ffDestroyGPUOptions (FFGPUOptions * options ) {
@@ -462,7 +463,7 @@ FFModuleBaseInfo ffGPUModuleInfo = {
462463 .printModule = (void * ) ffPrintGPU ,
463464 .generateJsonResult = (void * ) ffGenerateGPUJsonResult ,
464465 .generateJsonConfig = (void * ) ffGenerateGPUJsonConfig ,
465- .formatArgs = FF_FORMAT_ARG_LIST (((FFModuleFormatArg []) {
466+ .formatArgs = FF_FORMAT_ARG_LIST (((FFModuleFormatArg []){
466467 { "GPU vendor" , "vendor" },
467468 { "GPU name" , "name" },
468469 { "GPU driver" , "driver" },
0 commit comments