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

Git pushed a commit to branch master
in repository ffmpeg.

commit dd01289032d2f7f67db5b6ab28260ddb8cf3bafd
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 13 06:10:51 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Tue Oct 20 20:41:50 2026 +0000

    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
---
 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 1ecf95e938..59ab0a9c72 100644
--- a/libavfilter/dnn/dnn_backend_torch.cpp
+++ b/libavfilter/dnn/dnn_backend_torch.cpp
@@ -50,6 +50,7 @@ typedef struct THModel {
     SafeQueue *request_queue;
     Queue *task_queue;
     Queue *lltask_queue;
+    int nb_requests;
 } THModel;
 
 typedef struct THInferRequest {
@@ -130,7 +131,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);
@@ -676,6 +677,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;
     }
 

-- 
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