command: convert aspect, par, and sar sub-properties to double

These were still set to float. For some common aspect ratios (e.g. like
4:3), the loss of precision is significant. The underlying calculations
are already done with doubles so all that needs to be done is to change
the type of the sub-property.
This commit is contained in:
Dudemanguy
2025-01-31 19:19:09 -06:00
parent 17db9bdc50
commit 16828aa952
3 changed files with 5 additions and 4 deletions

View File

@@ -2450,10 +2450,10 @@ static int property_imgparams(const struct mp_image_params *p, int action, void
{"crop-y", SUB_PROP_INT(p->crop.y0), .unavailable = !has_crop},
{"crop-w", SUB_PROP_INT(mp_rect_w(p->crop)), .unavailable = !has_crop},
{"crop-h", SUB_PROP_INT(mp_rect_h(p->crop)), .unavailable = !has_crop},
{"aspect", SUB_PROP_FLOAT(d_w / (double)d_h)},
{"aspect", SUB_PROP_DOUBLE(d_w / (double)d_h)},
{"aspect-name", SUB_PROP_STR(aspect_name), .unavailable = !aspect_name},
{"par", SUB_PROP_FLOAT(p->p_w / (double)p->p_h)},
{"sar", SUB_PROP_FLOAT(p->w / (double)p->h)},
{"par", SUB_PROP_DOUBLE(p->p_w / (double)p->p_h)},
{"sar", SUB_PROP_DOUBLE(p->w / (double)p->h)},
{"sar-name", SUB_PROP_STR(sar_name), .unavailable = !sar_name},
{"colormatrix",
SUB_PROP_STR(m_opt_choice_str(pl_csp_names, p->repr.sys))},