summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-10 21:06:18 +0200
committerwm4 <wm4@nowhere>2015-04-10 21:06:25 +0200
commit37a71e57d404a708505f920f610061ec5c424917 (patch)
tree000ad1e9657175bd2fc9c8a77795d0f8abc8e766 /video/mp_image.c
parent41151122e73f82d0bc9a806c80165878e930dc07 (diff)
downloadmpv-37a71e57d404a708505f920f610061ec5c424917.tar.bz2
mpv-37a71e57d404a708505f920f610061ec5c424917.tar.xz
mp_image: remove redundant flags field
Because gcc (and clang) is a goddamn PITA and unnecessarily warns if the universal initializer for structs is used (like mp_image x = {}) and the first member of the struct is also a struct, move the w/h fields to the top.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r--video/mp_image.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index c4ad6bd4c2..12b8fc437c 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -146,7 +146,6 @@ void mp_image_setfmt(struct mp_image *mpi, int out_fmt)
struct mp_imgfmt_desc fmt = mp_imgfmt_get_desc(out_fmt);
mpi->params.imgfmt = fmt.id;
mpi->fmt = fmt;
- mpi->flags = fmt.flags;
mpi->imgfmt = fmt.id;
mpi->num_planes = fmt.num_planes;
mp_image_set_size(mpi, mpi->w, mpi->h);
@@ -358,7 +357,7 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src)
}
dst->params.primaries = src->params.primaries;
dst->params.gamma = src->params.gamma;
- if ((dst->flags & MP_IMGFLAG_YUV) == (src->flags & MP_IMGFLAG_YUV)) {
+ if ((dst->fmt.flags & MP_IMGFLAG_YUV) == (src->fmt.flags & MP_IMGFLAG_YUV)) {
dst->params.colorspace = src->params.colorspace;
dst->params.colorlevels = src->params.colorlevels;
dst->params.chroma_location = src->params.chroma_location;
@@ -414,9 +413,9 @@ void mp_image_clear(struct mp_image *img, int x0, int y0, int x1, int y1)
plane_clear[0] = av_le2ne16(0x0080);
} else if (area.imgfmt == IMGFMT_NV12 || area.imgfmt == IMGFMT_NV21) {
plane_clear[1] = 0x8080;
- } else if (area.flags & MP_IMGFLAG_YUV_P) {
+ } else if (area.fmt.flags & MP_IMGFLAG_YUV_P) {
uint16_t chroma_clear = (1 << area.fmt.plane_bits) / 2;
- if (!(area.flags & MP_IMGFLAG_NE))
+ if (!(area.fmt.flags & MP_IMGFLAG_NE))
chroma_clear = av_bswap16(chroma_clear);
if (area.num_planes > 2)
plane_clear[1] = plane_clear[2] = chroma_clear;