Commit c24469e8 authored by Janne Grunau's avatar Janne Grunau

utils: add workaround for AVHWAccel in ff_get_buffer compat code

Since c977039e plane count for
PIX_FMT_HWACCEL pixel formats is 0 instead of 1. The created dummy
AVBuffers are still bogus since AVFrame does not hold frame data when
AVHWAccels are used.
parent 2ece5bf3
...@@ -661,6 +661,10 @@ do { \ ...@@ -661,6 +661,10 @@ do { \
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
planes = av_pix_fmt_count_planes(frame->format); planes = av_pix_fmt_count_planes(frame->format);
/* workaround for AVHWAccel plane count of 0, buf[0] is used as
check for allocated buffers: make libavcodec happy */
if (desc && desc->flags & PIX_FMT_HWACCEL)
planes = 1;
if (!desc || planes <= 0) { if (!desc || planes <= 0) {
ret = AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto fail; goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment