diff options
author | Guo, Yejun <yejun.guo@intel.com> | 2021-02-08 18:46:27 +0800 |
---|---|---|
committer | Guo, Yejun <yejun.guo@intel.com> | 2021-02-18 09:59:37 +0800 |
commit | 995c33a046bf058c79947755fc26c8fea5edb410 (patch) | |
tree | 588b3af24138e461e2261dd6644dfc65da4cccde /libavfilter | |
parent | 51c105a62d931b6c27c8cad5b9aba3fd1de43668 (diff) | |
download | ffmpeg-995c33a046bf058c79947755fc26c8fea5edb410.tar.gz |
dnn_backend_openvino.c: fix multi-thread issue for async execution
once we mark done for the task in function infer_completion_callback,
the task is possible to be release in function ff_dnn_get_async_result_ov
in another thread just after it, so we need to record request queue
first, instead of using task->ov_model->request_queue later.
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/dnn/dnn_backend_openvino.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c index 48f5ba50be..ed41b721fc 100644 --- a/libavfilter/dnn/dnn_backend_openvino.c +++ b/libavfilter/dnn/dnn_backend_openvino.c @@ -178,6 +178,7 @@ static void infer_completion_callback(void *args) IEStatusCode status; RequestItem *request = args; TaskItem *task = request->tasks[0]; + SafeQueue *requestq = task->ov_model->request_queue; ie_blob_t *output_blob = NULL; ie_blob_buffer_t blob_buffer; DNNData output; @@ -243,7 +244,7 @@ static void infer_completion_callback(void *args) request->task_count = 0; if (task->async) { - if (ff_safe_queue_push_back(task->ov_model->request_queue, request) < 0) { + if (ff_safe_queue_push_back(requestq, request) < 0) { av_log(ctx, AV_LOG_ERROR, "Failed to push back request_queue.\n"); return; } |