]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libvpxdec.c
lavf/mpjpeg: do not include CRLF preceding boundary as part of the returned frame
[ffmpeg] / libavcodec / libvpxdec.c
index 698c546277b3abd72a93083681edbe77fa73c352..b51bfa2f4313b9151633097e8922687721a78419 100644 (file)
@@ -68,6 +68,12 @@ 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,
     };
+#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)