[FFmpeg-cvslog] avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit

Srikanth G git at videolan.org
Sat Mar 7 00:43:58 CET 2015


ffmpeg | branch: release/2.4 | Srikanth G <gskanth at gmail.com> | Wed Mar  4 18:48:54 2015 -0600| [7071b8192d26c51c751ec8f8e0bc809d7377c95f] | committer: James Almer

avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit

When OpenCL kernels are compiled, is_compiled flag is being set for each
kernel. But, in opencl uninit, this flag is not being cleared.
This causes an error when an OpenCL kernel is tried on different OpenCL
devices on same platform.

Here is the patch with a fix

Reviewed-by; Wei Gao <highgod0401 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

(cherry picked from commit 0f2359b86926ed33da4bd64ca76d84d03d5ad380)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7071b8192d26c51c751ec8f8e0bc809d7377c95f
---

 libavutil/opencl.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/opencl.c b/libavutil/opencl.c
index 0b4f83b..f80cde7 100644
--- a/libavutil/opencl.c
+++ b/libavutil/opencl.c
@@ -633,6 +633,9 @@ void av_opencl_uninit(void)
         }
         opencl_ctx.context = NULL;
     }
+    for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
+        opencl_ctx.kernel_code[i].is_compiled = 0;
+    }
     free_device_list(&opencl_ctx.device_list);
 end:
     if (opencl_ctx.init_count <= 0)



More information about the ffmpeg-cvslog mailing list