On 19/02/2017 19:46, Mark Thompson wrote:
> ---
> configure | 3 +
> doc/APIchanges | 4 +
> libavutil/Makefile | 2 +
> libavutil/hwcontext.c | 3 +
> libavutil/hwcontext.h | 1 +
> libavutil/hwcontext_internal.h | 1 +
> libavutil/hwcontext_opencl.c | 983
> +++++++++++++++++++++++++++++++++++++++++
> libavutil/hwcontext_opencl.h | 78 ++++
> libavutil/version.h | 2 +-
> 9 files changed, 1076 insertions(+), 1 deletion(-)
> create mode 100644 libavutil/hwcontext_opencl.c
> create mode 100644 libavutil/hwcontext_opencl.h
> +
> + av_log(hwdev, AV_LOG_DEBUG, "Format %s supported.\n",
> + av_get_pix_fmt_name(pix_fmt));
> +
> + constraints->valid_sw_formats =
> + av_realloc_array(constraints->valid_sw_formats,
> + pix_fmts_found + 2,
> + sizeof(*constraints->valid_sw_formats));
Use av_reallocp_array maybe?
> + if (!constraints->valid_sw_formats) {
> + err = AVERROR(ENOMEM);
> + goto fail;
> + }
> + constraints->valid_sw_formats[pix_fmts_found] = pix_fmt;
> + constraints->valid_sw_formats[pix_fmts_found + 1] =
> + AV_PIX_FMT_NONE;
maybe that could be set outside the loop only once.
> + ++pix_fmts_found;
> + }
> +
The rest seems ok.
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel