[FFmpeg-devel] [PATCH 3/5] avfilter/dnn: fix the return value of async_thread_routine
Michael Niedermayer
michael at niedermayer.cc
Thu Dec 9 16:00:06 EET 2021
On Thu, Dec 09, 2021 at 09:19:41AM +0800, lance.lmwang at gmail.com wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> libavfilter/dnn/dnn_backend_common.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/dnn/dnn_backend_common.c b/libavfilter/dnn/dnn_backend_common.c
> index 6a9c4cc..8c020e5 100644
> --- a/libavfilter/dnn/dnn_backend_common.c
> +++ b/libavfilter/dnn/dnn_backend_common.c
> @@ -83,10 +83,13 @@ static void *async_thread_routine(void *args)
> void *request = async_module->args;
>
> if (async_module->start_inference(request) != DNN_SUCCESS) {
> - return DNN_ASYNC_FAIL;
> + pthread_exit((void*)DNN_ASYNC_FAIL);
> + return NULL;
> }
> async_module->callback(request);
> - return DNN_ASYNC_SUCCESS;
> +
> + pthread_exit((void*)DNN_ASYNC_SUCCESS);
> + return NULL;
> }
seems to break build on mingw64
src/libavfilter/dnn/dnn_backend_common.c: In function ‘async_thread_routine’:
src/libavfilter/dnn/dnn_backend_common.c:86:9: error: implicit declaration of function ‘pthread_exit’; did you mean ‘pthread_join’? [-Werror=implicit-function-declaration]
pthread_exit((void*)DNN_ASYNC_FAIL);
^~~~~~~~~~~~
pthread_join
src/libavfilter/dnn/dnn_backend_common.c: In function ‘ff_dnn_async_module_cleanup’:
src/libavfilter/dnn/dnn_backend_common.c:97:11: warning: unused variable ‘status’ [-Wunused-variable]
void *status = 0;
^~~~~~
src/libavfilter/dnn/dnn_backend_common.c: In function ‘ff_dnn_start_inference_async’:
src/libavfilter/dnn/dnn_backend_common.c:117:11: warning: unused variable ‘status’ [-Wunused-variable]
void *status = 0;
^~~~~~
src/libavfilter/dnn/dnn_backend_common.c:116:9: warning: unused variable ‘ret’ [-Wunused-variable]
int ret;
^~~
At top level:
src/libavfilter/dnn/dnn_backend_common.c:80:14: warning: ‘async_thread_routine’ defined but not used [-Wunused-function]
static void *async_thread_routine(void *args)
^~~~~~~~~~~~~~~~~~~~
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20211209/87a18fa3/attachment.sig>
More information about the ffmpeg-devel
mailing list