Skip to content

Commit dd4f006

Browse files
committed
GPU: support "hideType": null
1 parent c491c9e commit dd4f006

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

src/modules/gpu/gpu.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,23 @@ void ffParseGPUJsonObject(FFGPUOptions* options, yyjson_val* module)
240240

241241
if (unsafe_yyjson_equals_str(key, "hideType"))
242242
{
243-
int value;
244-
const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]) {
245-
{ "none", FF_GPU_TYPE_NONE },
246-
{ "unknown", FF_GPU_TYPE_UNKNOWN },
247-
{ "integrated", FF_GPU_TYPE_INTEGRATED },
248-
{ "discrete", FF_GPU_TYPE_DISCRETE },
249-
{},
250-
});
251-
if (error)
252-
ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Invalid %s value: %s", unsafe_yyjson_get_str(key), error);
243+
if (yyjson_is_null(val))
244+
options->hideType = FF_GPU_TYPE_NONE;
253245
else
254-
options->hideType = (FFGPUType) value;
246+
{
247+
int value;
248+
const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]) {
249+
{ "none", FF_GPU_TYPE_NONE },
250+
{ "unknown", FF_GPU_TYPE_UNKNOWN },
251+
{ "integrated", FF_GPU_TYPE_INTEGRATED },
252+
{ "discrete", FF_GPU_TYPE_DISCRETE },
253+
{},
254+
});
255+
if (error)
256+
ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "Invalid %s value: %s", unsafe_yyjson_get_str(key), error);
257+
else
258+
options->hideType = (FFGPUType) value;
259+
}
255260
continue;
256261
}
257262

0 commit comments

Comments
 (0)