[FFmpeg-devel] [PATCH] lavu: add calling convention for OpenCL callback.

Mark Thompson sw at jkqxz.net
Thu Jun 7 01:21:21 EEST 2018


On 06/06/18 16:31, Ruiling Song wrote:
> This fix a build error on Windows:
> C2440: connot convert from 'void (__cdecl *) (...)' to 'void (__stdcall *)(...)'.
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  libavutil/hwcontext_opencl.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
> index 43b5c5a..e08d7bc 100644
> --- a/libavutil/hwcontext_opencl.c
> +++ b/libavutil/hwcontext_opencl.c
> @@ -141,9 +141,10 @@ typedef struct OpenCLFramesContext {
>  } OpenCLFramesContext;
>  
>  
> -static void opencl_error_callback(const char *errinfo,
> -                                  const void *private_info, size_t cb,
> -                                  void *user_data)
> +static void CL_CALLBACK opencl_error_callback(const char *errinfo,
> +                                              const void *private_info,
> +                                              size_t cb,
> +                                              void *user_data)
>  {
>      AVHWDeviceContext *ctx = user_data;
>      av_log(ctx, AV_LOG_ERROR, "OpenCL error: %s\n", errinfo);
> 

Yep, applied.

Is this visible in any MSVC build, or does it have to be 32-bit?  (All my testing on Windows has been done with MinGW-w64, where __stdcall/__cdecl have no effect and this goes unnoticed.)

Thanks,

- Mark


More information about the ffmpeg-devel mailing list