summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-08 17:24:28 -0500
committerDudemanguy <random342@airmail.cc>2023-08-09 13:51:28 +0000
commit1df0a42a8cb12005311f6a03f3a1c4329c798f8c (patch)
treea437d1a5782f2aeb8e17202bed151f1ba5e67dd4 /options/m_option.h
parentefefe3a6dcfb969ab9f5800b7aecb3ba685ffdbe (diff)
downloadmpv-1df0a42a8cb12005311f6a03f3a1c4329c798f8c.tar.bz2
mpv-1df0a42a8cb12005311f6a03f3a1c4329c798f8c.tar.xz
m_option: change m_option_type_aspect to double
This specific option type is only used for the video aspect. The underlying type was a float to represent the inputted value, but it's actually not precise enough. When using something like 4:3, the values of the incorrect digits are actually significant enough to make av_d2q return a very funky numerator and denominator which is close to 4/3 but not quite. This leads to some "off by one pixel" errors. Weirdly, mpv's actual calculations for this were already being done as double, but then converted to floats for this specific type. Just drop the conversion step and leave it all as double which has the precision we need (i.e. AVRational is now 4/3 for the this case). Fixes #8190.
Diffstat (limited to 'options/m_option.h')
-rw-r--r--options/m_option.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/options/m_option.h b/options/m_option.h
index bcdc1f9fcc..1adac938e4 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -661,7 +661,7 @@ extern const char m_option_path_separator;
OPT_TYPED_FIELD(m_option_type_msglevels, char **, field)
#define OPT_ASPECT(field) \
- OPT_TYPED_FIELD(m_option_type_aspect, float, field)
+ OPT_TYPED_FIELD(m_option_type_aspect, double, field)
#define OPT_IMAGEFORMAT(field) \
OPT_TYPED_FIELD(m_option_type_imgfmt, int, field)