This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.0
in repository ffmpeg.

commit 20028f6ca1150dcfef70f36010836fd9697b810c
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 13 06:10:51 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 26 22:32:57 2026 +0100

    avfilter/dnn_backend_torch: wait only for the inference requests that were 
created
    
    Fixes: nC3u8khGyx61
    Fixes: hang on teardown
    Hang on teardown Replicated through UnModified FFmpeg with gdb
    Found during triage of the review of 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
    
    (cherry picked from commit dd01289032d2f7f67db5b6ab28260ddb8cf3bafd)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/dnn/dnn_backend_torch.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/dnn/dnn_backend_torch.cpp 
b/libavfilter/dnn/dnn_backend_torch.cpp
index 0cbfc1a2c3..de741c546a 100644
--- a/libavfilter/dnn/dnn_backend_torch.cpp
+++ b/libavfilter/dnn/dnn_backend_torch.cpp
@@ -42,6 +42,7 @@ typedef struct THModel {
     SafeQueue *request_queue;
     Queue *task_queue;
     Queue *lltask_queue;
+    int nb_requests;
 } THModel;
 
 typedef struct THInferRequest {
@@ -121,7 +122,7 @@ static void dnn_free_model_th(DNNModel **model)
     th_model = (THModel *)(*model);
 
     if (th_model->request_queue) {
-        ff_dnn_wait_requests(th_model->request_queue, th_model->ctx->nireq);
+        ff_dnn_wait_requests(th_model->request_queue, th_model->nb_requests);
         while (ff_safe_queue_size(th_model->request_queue) != 0) {
             THRequestItem *item = (THRequestItem 
*)ff_safe_queue_pop_front(th_model->request_queue);
             destroy_request_item(&item);
@@ -483,6 +484,7 @@ static DNNModel *dnn_load_model_th(DnnContext *ctx, 
DNNFunctionType func_type, A
     if (ff_safe_queue_push_back(th_model->request_queue, item) < 0) {
         goto fail;
     }
+    th_model->nb_requests++;
     item = NULL;
 
     th_model->task_queue = ff_queue_create();

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to