avfilter/dnn: fix missing set default value to options

There are two options which use non-zero default value: async and
batch_size of openvino. init_model_ov checks and set batch_size to
one when batch_size is equal to zero, so the only option affected
by missing default value is async. Now async works as expected.
This commit is contained in:
Zhao Zhili
2026-03-04 21:42:31 +08:00
committed by Guo Yejun
parent ba38fa206e
commit 6fdbb5a93e

View File

@@ -98,6 +98,8 @@ void ff_dnn_init_child_class(DnnContext *ctx)
for (int i = 0; i < FF_ARRAY_ELEMS(dnn_backend_info_list); i++) {
const AVClass **ptr = (const AVClass **) ((char *) ctx + dnn_backend_info_list[i].offset);
*ptr = dnn_backend_info_list[i].class;
// Set default values after the class pointer is set
av_opt_set_defaults(ptr);
}
}