mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-08-10 07:37:43 +00:00
When the filter graph is torn down early (e.g. at EOF with -frames:v), the main thread calls dnn_free_model and destroys the request queue while async inference threads may still be running. When a detached thread finishes and tries to push its result back to the destroyed queue, it triggers a segmentation fault. Add ff_dnn_wait_requests() to dnn_backend_common which blocks until all allocated request items (ctx->nireq) have been safely returned to the request_queue. Call it from dnn_free_model in the torch, tensorflow, openvino, and onnx backends before destroying the queue.