summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-26 21:30:33 +0100
committerwm4 <wm4@nowhere>2013-01-13 20:04:13 +0100
commit8d6a66892ec8fbca28fa5f494ff6ee6994f2fe13 (patch)
treef8ad7e3d1ddce85c53f66f5cc3f38f02a3e384b6 /video/filter
parentd88baf0754808e3252bfdfe37f78dbbe310bf17a (diff)
downloadmpv-8d6a66892ec8fbca28fa5f494ff6ee6994f2fe13.tar.bz2
mpv-8d6a66892ec8fbca28fa5f494ff6ee6994f2fe13.tar.xz
vf_swapuv: support more image formats
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_swapuv.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/video/filter/vf_swapuv.c b/video/filter/vf_swapuv.c
index a9083ccaa8..10dc1da858 100644
--- a/video/filter/vf_swapuv.c
+++ b/video/filter/vf_swapuv.c
@@ -39,18 +39,14 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
return mpi;
}
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- switch(fmt)
- {
- case IMGFMT_444P:
- case IMGFMT_422P:
- case IMGFMT_440P:
- case IMGFMT_420P:
- case IMGFMT_411P:
- case IMGFMT_410P:
- return vf_next_query_format(vf, fmt);
- }
- return 0;
+static int query_format(struct vf_instance *vf, unsigned int fmt)
+{
+ struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(fmt);
+ if (!(desc.flags & MP_IMGFLAG_BYTE_ALIGNED))
+ return 0;
+ if (!(desc.num_planes >= 3 && desc.bytes[1] == desc.bytes[2]))
+ return 0;
+ return vf_next_query_format(vf, fmt);
}
static int vf_open(vf_instance_t *vf, char *args){