In opencl device derived case, don't need to call opencl_device_init. Signed-off-by: Jun Zhao <mypopy...@gmail.com> --- libavutil/hwcontext_opencl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 9e96e96..295d6be 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -1196,7 +1196,7 @@ static int opencl_device_derive(AVHWDeviceContext *hwdev, AVHWDeviceContext *src_ctx, int flags) { - int err; + int err = 0; switch (src_ctx->type) { #if HAVE_OPENCL_DRM_BEIGNET @@ -1362,10 +1362,7 @@ static int opencl_device_derive(AVHWDeviceContext *hwdev, break; } - if (err < 0) - return err; - - return opencl_device_init(hwdev); + return err; } static int opencl_get_plane_format(enum AVPixelFormat pixfmt, -- 2.7.4 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel