diff options
author | wm4 <wm4@nowhere> | 2013-01-14 18:37:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-14 18:37:17 +0100 |
commit | 8f5ef883c1423112ecfba85705972c880643104d (patch) | |
tree | b5e599029ae1bf15422e2e8c235514ea6cd1d203 /video | |
parent | f0a08a9fdf3ac9b30089820e61606ace493f4fcd (diff) | |
download | mpv-8f5ef883c1423112ecfba85705972c880643104d.tar.bz2 mpv-8f5ef883c1423112ecfba85705972c880643104d.tar.xz |
img_format: do not mark hwaccel formats as planar yuv formats
Diffstat (limited to 'video')
-rw-r--r-- | video/img_format.c | 15 |
1 files changed, 8 insertions, 7 deletions
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; |