GPU: handles missing GPU type as null in JSON output

This commit is contained in:
李通洲
2025-11-01 16:44:36 +08:00
parent 907567f511
commit e63b777916
+5 -2
View File
@@ -386,9 +386,12 @@ bool ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
{
case FF_GPU_TYPE_INTEGRATED: type = "Integrated"; break;
case FF_GPU_TYPE_DISCRETE: type = "Discrete"; break;
default: type = "Unknown"; break;
default: type = NULL; break;
}
yyjson_mut_obj_add_str(doc, obj, "type", type);
if (type)
yyjson_mut_obj_add_str(doc, obj, "type", type);
else
yyjson_mut_obj_add_null(doc, obj, "type");
yyjson_mut_obj_add_strbuf(doc, obj, "vendor", &gpu->vendor);