Message ID | 1d0ee491-9296-086b-bd4e-01c6846ac504@jkqxz.net |
---|---|
State | Accepted |
Headers | show |
> -----Original Message----- > From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of > Mark Thompson > Sent: Monday, November 26, 2018 6:08 AM > To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> > Subject: [FFmpeg-devel] [PATCH] hwcontext_opencl: Use correct function to > enumerate devices > > --- > libavutil/hwcontext_opencl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c > index e6cef74269..6a26354c87 100644 > --- a/libavutil/hwcontext_opencl.c > +++ b/libavutil/hwcontext_opencl.c > @@ -542,9 +542,9 @@ static int > opencl_device_create_internal(AVHWDeviceContext *hwdev, > continue; > } > > - err = opencl_enumerate_devices(hwdev, platforms[p], platform_name, > - &nb_devices, &devices, > - selector->context); > + err = selector->enumerate_devices(hwdev, platforms[p], platform_name, > + &nb_devices, &devices, > + selector->context); I think it is better to check enumerate_devices against null pointer before calling it, although it should works well currently. Ruiling > if (err < 0) > continue; > > -- > 2.19.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index e6cef74269..6a26354c87 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -542,9 +542,9 @@ static int opencl_device_create_internal(AVHWDeviceContext *hwdev, continue; } - err = opencl_enumerate_devices(hwdev, platforms[p], platform_name, - &nb_devices, &devices, - selector->context); + err = selector->enumerate_devices(hwdev, platforms[p], platform_name, + &nb_devices, &devices, + selector->context); if (err < 0) continue;