diff options
author | Niklas Haas <git@nand.wakku.to> | 2016-06-29 09:16:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-03 19:42:52 +0200 |
commit | d81fb97f4587f73f62a760b99f686139f9b8d966 (patch) | |
tree | f97ec972e64160e1a479c1b31daf73af32ca54e1 /video/sws_utils.c | |
parent | 3abf9c9204e2fcbc1910deb102efab4ab9d8c149 (diff) | |
download | mpv-d81fb97f4587f73f62a760b99f686139f9b8d966.tar.bz2 mpv-d81fb97f4587f73f62a760b99f686139f9b8d966.tar.xz |
mp_image: split colorimetry metadata into its own struct
This has two reasons:
1. I tend to add new fields to this metadata, and every time I've done
so I've consistently forgotten to update all of the dozens of places in
which this colorimetry metadata might end up getting used. While most
usages don't really care about most of the metadata, sometimes the
intend was simply to “copy” the colorimetry metadata from one struct to
another. With this being inside a substruct, those lines of code can now
simply read a.color = b.color without having to care about added or
removed fields.
2. It makes the type definitions nicer for upcoming refactors.
In going through all of the usages, I also expanded a few where I felt
that omitting the “young” fields was a bug.
Diffstat (limited to 'video/sws_utils.c')
-rw-r--r-- | video/sws_utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/video/sws_utils.c b/video/sws_utils.c index ce44c67eeb..45918b19d1 100644 --- a/video/sws_utils.c +++ b/video/sws_utils.c @@ -192,11 +192,11 @@ int mp_sws_reinit(struct mp_sws_context *ctx) return -1; } - int s_csp = mp_csp_to_sws_colorspace(src->colorspace); - int s_range = src->colorlevels == MP_CSP_LEVELS_PC; + int s_csp = mp_csp_to_sws_colorspace(src->color.space); + int s_range = src->color.levels == MP_CSP_LEVELS_PC; - int d_csp = mp_csp_to_sws_colorspace(dst->colorspace); - int d_range = dst->colorlevels == MP_CSP_LEVELS_PC; + int d_csp = mp_csp_to_sws_colorspace(dst->color.space); + int d_range = dst->color.levels == MP_CSP_LEVELS_PC; // Work around libswscale bug #1852 (fixed in ffmpeg commit 8edf9b1fa): // setting range flags for RGB gives random bogus results. |