[FFmpeg-devel] [PATCH 3/5] avfilter/dnn: fix the return value of async_thread_routine

lance.lmwang at gmail.com lance.lmwang at gmail.com
Thu Dec 9 16:19:11 EET 2021


On Thu, Dec 09, 2021 at 03:00:06PM +0100, Michael Niedermayer wrote:
> 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
> 
> 

It's strange, for I saw pthread_exit() is used by vf_libvmaf.c. Anyway,
I realized it should be OK to add (void*) before the error code. 

> 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



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list