From 6eccd4a573b5c1d15ce83ef3c261e775ddca0685 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 Jan 2016 16:54:01 +0100 Subject: img_format: fix compilation on older libavutil releases AVComponentDescriptor.offset was introduced relatively recently. On older releases, you have to use AVComponentDescriptor.offset_plus1, which is now deprecated. Instead of adding ifdeffery, assume AV_PIX_FMT_NV21 is the only format for which this applies (and will remain the only case), which is probably true enough. --- video/img_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/img_format.c b/video/img_format.c index c9bdd763b0..67ad3e2bdd 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -265,7 +265,7 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt) { desc.flags |= MP_IMGFLAG_YUV_NV; - if (pd->comp[1].offset > pd->comp[2].offset) + if (fmt == AV_PIX_FMT_NV21) desc.flags |= MP_IMGFLAG_YUV_NV_SWAP; } if (desc.flags & (MP_IMGFLAG_YUV_P | MP_IMGFLAG_RGB_P | MP_IMGFLAG_YUV_NV)) -- cgit v1.2.3