[FFmpeg-devel] [PATCH] opencl: Fix compilation with threading disabled

James Almer jamrial at gmail.com
Wed Apr 10 21:28:15 CEST 2013


On 10/04/13 4:15 PM, Reimar Döffinger wrote:
> 
> 
> On 10.04.2013, at 10:17, James Almer <jamrial at gmail.com> wrote:
> 
>> Fixes ticket #2448
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>> libavutil/opencl.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/libavutil/opencl.c b/libavutil/opencl.c
>> index d0f75b9..00fb99b 100644
>> --- a/libavutil/opencl.c
>> +++ b/libavutil/opencl.c
>> @@ -269,6 +269,7 @@ void av_opencl_release_kernel(AVOpenCLKernelEnv *env)
>>     gpu_env.kernel_count--;
>> end:
>>     UNLOCK_OPENCL
>> +    return;
>> }
>>
>> static int init_opencl_env(GPUEnv *gpu_env, AVOpenCLExternalEnv *ext_opencl_env)
>> @@ -598,6 +599,7 @@ void av_opencl_uninit(void)
>>     av_freep(&(gpu_env.device_ids));
>> end:
>>     UNLOCK_OPENCL
>> +    return;
> 
> This is quite ugly and non-obvious.
> If the fallback version defines the macro to something empty: that is a very bad idea, imagine someone using it in an else clause without surrounding {}.
> It should be defined as "do {} while (0)".

I'll leave this to Wei Gao, then. He's still changing things around and I'm not sure what
he plans to do with these macros.

Regards.


More information about the ffmpeg-devel mailing list