aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-29 22:45:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-29 22:52:04 +0200
commit811d58e08386e4b948de324c766c1a9143ebd116 (patch)
tree42cf15b3c1191527295f9164fd5dd4d743511d6d
parentcf06dee58d6ea0870dcdf5463fcf2aef97f0daa7 (diff)
downloadffmpeg-811d58e08386e4b948de324c766c1a9143ebd116.tar.gz
avcodec/utils: support non edge emu for grayscale
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0be9340253..4dbd834136 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -568,6 +568,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
for (i = 0; i < 4 && pool->pools[i]; i++) {
const int h_shift = i == 0 ? 0 : h_chroma_shift;
const int v_shift = i == 0 ? 0 : v_chroma_shift;
+ int is_planar = pool->pools[2] || (i==0 && s->pix_fmt == AV_PIX_FMT_GRAY8);
pic->linesize[i] = pool->linesize[i];
@@ -576,7 +577,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
goto fail;
// no edge if EDGE EMU or not planar YUV
- if ((s->flags & CODEC_FLAG_EMU_EDGE) || !pool->pools[2])
+ if ((s->flags & CODEC_FLAG_EMU_EDGE) || !is_planar)
pic->data[i] = pic->buf[i]->data;
else {
pic->data[i] = pic->buf[i]->data +