From 59bcf5206daadd1c775255c1fcf582f9e7347987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 24 Jun 2023 19:49:53 +0800 Subject: [PATCH] GPU: print GPU type by default --- src/modules/gpu/gpu.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index 6c34aa82c..d7ec2d246 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -13,6 +13,14 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResult* gpu) { + const char* type; + switch (gpu->type) + { + case FF_GPU_TYPE_INTEGRATED: type = "Integrated"; break; + case FF_GPU_TYPE_DISCRETE: type = "Discrete"; break; + default: type = "Unknown"; break; + } + if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_GPU_MODULE_NAME, index, &options->moduleArgs.key, &options->moduleArgs.keyColor); @@ -51,18 +59,13 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu ffStrbufAppendC(&output, ')'); } + if (gpu->type != FF_GPU_TYPE_UNKNOWN) + ffStrbufAppendF(&output, " [%s]", type); + ffStrbufPutTo(&output, stdout); } else { - const char* type; - if(gpu->type == FF_GPU_TYPE_INTEGRATED) - type = "Integrated"; - else if(gpu->type == FF_GPU_TYPE_DISCRETE) - type = "Discrete"; - else - type = "Unknown"; - ffPrintFormat(FF_GPU_MODULE_NAME, index, &options->moduleArgs, FF_GPU_NUM_FORMAT_ARGS, (FFformatarg[]){ {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->vendor}, {FF_FORMAT_ARG_TYPE_STRBUF, &gpu->name},