summaryrefslogtreecommitdiffstats
path: root/sub/osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-07 22:20:51 +0100
committerwm4 <wm4@nowhere>2016-03-07 22:22:18 +0100
commit5fa45fb5641c95a5dc65faac2087d842333b5425 (patch)
tree0807f5cff191b18427b36ebf5d30de25620ae033 /sub/osd.c
parentb7617f42d873adceebd3904d906e4eff818240ed (diff)
downloadmpv-5fa45fb5641c95a5dc65faac2087d842333b5425.tar.bz2
mpv-5fa45fb5641c95a5dc65faac2087d842333b5425.tar.xz
osd, lua: remove weird OSD scaling
Do not scale OSD mouse input to the ASS OSD script resolution. The original idea of this mechanism was that the user doesn't have to care about the actual resolution of anything, and can just use the OSD resolution consistently. But this made things worse. Remove the implicit scaling, and always use the screen resolution. (Except with --vo=xv, where additional scaling is forced upon everything.) Drop get_osd_resolution(). There is no replacement. Rename get_screen_size() and get_screen_margins() to use "osd" instead of "screen". For anything but --vo=xv these are equivalent, but with --vo=xv the OSD resolution has additional implicit scaling. Add code to osc.lua which emulates the old behavior. Note that none of the changed functions were public API, so implicit breakage of scripts which used it is just going to happen.
Diffstat (limited to 'sub/osd.c')
-rw-r--r--sub/osd.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sub/osd.c b/sub/osd.c
index 81cfb7daa6..a9bc035c73 100644
--- a/sub/osd.c
+++ b/sub/osd.c
@@ -422,21 +422,6 @@ bool osd_query_and_reset_want_redraw(struct osd_state *osd)
return r;
}
-// Scale factor to translate OSD coordinates to what the obj uses internally.
-// osd_coordinates * (sw, sh) = obj_coordinates
-void osd_object_get_scale_factor(struct osd_state *osd, int obj,
- double *sw, double *sh)
-{
- int nw, nh;
- osd_object_get_resolution(osd, obj, &nw, &nh);
- pthread_mutex_lock(&osd->lock);
- int vow = osd->objs[obj]->vo_res.w;
- int voh = osd->objs[obj]->vo_res.h;
- pthread_mutex_unlock(&osd->lock);
- *sw = vow ? nw / (double)vow : 0;
- *sh = voh ? nh / (double)voh : 0;
-}
-
struct mp_osd_res osd_get_vo_res(struct osd_state *osd, int obj)
{
pthread_mutex_lock(&osd->lock);