From 653b0dd5295453d9661f673b4ebd02c5ceacf645 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 28 Feb 2015 01:39:31 +0100 Subject: screenshots: check for AVFrame csp support Apparently, libav stable is old enough to not have these fields. --- video/image_writer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video') diff --git a/video/image_writer.c b/video/image_writer.c index ab00b5bb01..700e1c4284 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -133,10 +133,12 @@ static int write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp) pic->format = avctx->pix_fmt; pic->width = avctx->width; pic->height = avctx->height; +#if HAVE_AVFRAME_CSP if (ctx->opts->tag_csp) { pic->color_primaries = mp_csp_prim_to_avcol_pri(image->params.primaries); pic->color_trc = mp_csp_trc_to_avcol_trc(image->params.gamma); } +#endif int ret = avcodec_encode_video2(avctx, &pkt, pic, &got_output); if (ret < 0) goto error_exit; -- cgit v1.2.3