[FFmpeg-devel] [PATCH] libvpxdec: fix 'ISO C90 forbids mixed declarations and code' warning

James Zern jzern at google.com
Tue Jan 12 07:43:52 CET 2016


since:
cbcc88c libvpx: Support setting color range for vp9.

Signed-off-by: James Zern <jzern at google.com>
---
 libavcodec/libvpxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index de72be9..b51bfa2 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -68,13 +68,13 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
         AVCOL_SPC_UNSPECIFIED, AVCOL_SPC_BT470BG, AVCOL_SPC_BT709, AVCOL_SPC_SMPTE170M,
         AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED, AVCOL_SPC_RGB,
     };
-    avctx->colorspace = colorspaces[img->cs];
 #if VPX_IMAGE_ABI_VERSION >= 4
     static const enum AVColorRange color_ranges[] = {
         AVCOL_RANGE_MPEG, AVCOL_RANGE_JPEG
     };
     avctx->color_range = color_ranges[img->range];
 #endif
+    avctx->colorspace = colorspaces[img->cs];
 #endif
     if (avctx->codec_id == AV_CODEC_ID_VP8 && img->fmt != VPX_IMG_FMT_I420)
         return AVERROR_INVALIDDATA;
-- 
2.6.0.rc2.230.g3dd15c0



More information about the ffmpeg-devel mailing list