PR #22380 opened by Zhao Zhili (quink)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22380
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22380.patch

There are two options which use non-zero default value: async and
batch_size of openvino. init_model_ov check and set batch_size to
1 when batch_size is equal to zero, so the only option affected by
missing default value is async. Now async works as expected.


>From b24a36365fee37a34268e5578e416a986758894f Mon Sep 17 00:00:00 2001
From: Zhao Zhili <[email protected]>
Date: Wed, 4 Mar 2026 21:42:31 +0800
Subject: [PATCH] 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 check and set batch_size to
1 when batch_size is equal to zero, so the only option affected by
missing default value is async. Now async works as expected.
---
 libavfilter/dnn/dnn_interface.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/dnn/dnn_interface.c b/libavfilter/dnn/dnn_interface.c
index c4e410756b..eb5475fde6 100644
--- a/libavfilter/dnn/dnn_interface.c
+++ b/libavfilter/dnn/dnn_interface.c
@@ -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((void *) ptr);
     }
 }
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to