mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
utils: add workaround for AVHWAccel in ff_get_buffer compat code
Since c977039e58
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.
This commit is contained in:
parent
2ece5bf3ec
commit
c24469e812
@ -661,6 +661,10 @@ do { \
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(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) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user