From e6ac328b79f42be2c92e8abec458e4b3a32c44f9 Mon Sep 17 00:00:00 2001
From: Jun Zhao <mypopydev@gmail.com>
Date: Wed, 20 Jun 2018 11:13:59 +0800
Subject: [PATCH] hwcontext_opencl: Remove the opencl_device_init in
 opencl_device_derive

In opencl device derived case, don't need to call opencl_device_init.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 libavutil/hwcontext_opencl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
index 06448c657d1..ad82ef6b2da 100644
--- a/libavutil/hwcontext_opencl.c
+++ b/libavutil/hwcontext_opencl.c
@@ -1361,10 +1361,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,
-- 
GitLab