libx264: check color_range
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 12 Mar 2014 11:05:42 +0000 (12:05 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Sun, 16 Mar 2014 22:31:30 +0000 (23:31 +0100)
libavcodec/libx264.c

index abf0a3e88769ab70bc5e055e848928d890493310..6233f1e3315958261f7b305fae4e6d5ead8d0cb6 100644 (file)
@@ -454,7 +454,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
 
     x4->params.i_slice_count  = avctx->slices;
 
-    x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P;
+    x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
+                                 avctx->color_range == AVCOL_RANGE_JPEG;
 
     if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
         x4->params.b_repeat_headers = 0;