[FFmpeg-cvslog] avcodec: make sure color_range is properly initialized

Vittorio Giovara git at videolan.org
Wed Oct 8 22:14:19 CEST 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Sep 26 16:07:55 2014 +0100| [147f2e91eece6b9021ff5b7f8a3b5ce053566659] | committer: Vittorio Giovara

avcodec: make sure color_range is properly initialized

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

 libavcodec/utils.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 80ba858..8ecf358 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1189,6 +1189,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
                 ret = AVERROR(EINVAL);
                 goto free_and_end;
             }
+            if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ420P ||
+                avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ422P ||
+                avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ440P ||
+                avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P)
+                avctx->color_range = AVCOL_RANGE_JPEG;
         }
         if (avctx->codec->supported_samplerates) {
             for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++)



More information about the ffmpeg-cvslog mailing list