[FFmpeg-cvslog] utils: add workaround for AVHWAccel in ff_get_buffer compat code
Janne Grunau
git at videolan.org
Wed Mar 27 11:50:11 CET 2013
ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Mon Mar 25 17:28:37 2013 +0100| [c24469e812501903a46a06eff9722a82e136e841] | committer: Janne Grunau
utils: add workaround for AVHWAccel in ff_get_buffer compat code
Since c977039e585bfff28ecc037ef827c6c3d1ed88aa 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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c24469e812501903a46a06eff9722a82e136e841
---
libavcodec/utils.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e64ca11..2b63759 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list