On Thu, 13 Mar 2014 22:42:21 +0100, Vittorio Giovara 
<[email protected]> wrote:
> ---
> I didn't notice color_range being set before. This version only sets it
> when it is unspecified.
> 
> Vittorio
> 
>  libavcodec/dirac.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
> index f0fb85d..b294734 100644
> --- a/libavcodec/dirac.c
> +++ b/libavcodec/dirac.c
> @@ -237,6 +237,8 @@ static int parse_source_parameters(AVCodecContext *avctx, 
> GetBitContext *gb,
>          av_log(avctx, AV_LOG_WARNING, "Bitdepth greater than 8");
>  
>      avctx->pix_fmt = dirac_pix_fmt[!luma_offset][source->chroma_format];
> +    if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
> +        avctx->color_range = luma_offset ? AVCOL_RANGE_JPEG : 
> AVCOL_RANGE_MPEG;
>  
>      /* [DIRAC_STD] 10.3.9 Colour specification. colour_spec(video_params) */
>      if (get_bits1(gb)) { /* [DIRAC_STD] custom_colour_spec_flag */
> -- 
> 1.8.3.4 (Apple Git-47)
> 

If you look at the code more closely, then you'll see that luma_offset is only
modified in the block that also sets color range. So the ? is unnecessary
(and I think the operands are swapped too)

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to