From 8f5ef883c1423112ecfba85705972c880643104d Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 14 Jan 2013 18:37:17 +0100 Subject: img_format: do not mark hwaccel formats as planar yuv formats --- video/img_format.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'video') diff --git a/video/img_format.c b/video/img_format.c index 0e35fd72a5..88cd6e80a2 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -203,7 +203,14 @@ static struct mp_imgfmt_desc get_avutil_fmt(enum PixelFormat fmt) if (desc.num_planes == pd->nb_components) desc.flags |= MP_IMGFLAG_PLANAR; - if (desc.flags & MP_IMGFLAG_YUV) { + if (!(pd->flags & PIX_FMT_HWACCEL) && !(pd->flags & PIX_FMT_BITSTREAM)) { + desc.flags |= MP_IMGFLAG_BYTE_ALIGNED; + for (int p = 0; p < desc.num_planes; p++) + desc.bytes[p] = desc.bpp[p] / 8; + } + + if ((desc.flags & MP_IMGFLAG_YUV) && (desc.flags & MP_IMGFLAG_BYTE_ALIGNED)) + { bool same_depth = true; for (int p = 0; p < desc.num_planes; p++) { same_depth &= planedepth[p] == planedepth[0] && @@ -213,12 +220,6 @@ static struct mp_imgfmt_desc get_avutil_fmt(enum PixelFormat fmt) desc.flags |= MP_IMGFLAG_YUV_P; } - if (!(pd->flags & PIX_FMT_HWACCEL) && !(pd->flags & PIX_FMT_BITSTREAM)) { - desc.flags |= MP_IMGFLAG_BYTE_ALIGNED; - for (int p = 0; p < desc.num_planes; p++) - desc.bytes[p] = desc.bpp[p] / 8; - } - for (int p = 0; p < desc.num_planes; p++) { desc.xs[p] = (p == 1 || p == 2) ? desc.chroma_xs : 0; desc.ys[p] = (p == 1 || p == 2) ? desc.chroma_ys : 0; -- cgit v1.2.3