[FFmpeg-cvslog] avcodec/mpeg12dec: Fix "-flags +gray"

Michael Niedermayer git at videolan.org
Sat May 9 17:30:42 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat May  9 15:58:02 2015 +0200| [33529104e56a0655b224d6082f885e6b828041ee] | committer: Michael Niedermayer

avcodec/mpeg12dec: Fix "-flags +gray"

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33529104e56a0655b224d6082f885e6b828041ee
---

 libavcodec/mpeg12dec.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 58505ce..ea7386c 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1235,6 +1235,9 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
     MpegEncContext *s = &s1->mpeg_enc_ctx;
     const enum AVPixelFormat *pix_fmts;
 
+    if (CONFIG_GRAY && (avctx->flags & CODEC_FLAG_GRAY))
+        return AV_PIX_FMT_GRAY8;
+
     if (s->chroma_format < 2)
         pix_fmts = avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
                                 mpeg1_hwaccel_pixfmt_list_420 :



More information about the ffmpeg-cvslog mailing list