New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autofit-smaller enlarges window beyond screen size #3753

Closed
nmaier opened this Issue Oct 31, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@nmaier
Contributor

nmaier commented Oct 31, 2016

mpv version and platform

HEAD (on OSX) and lachs0r's October build on Windows

Reproduction steps

Have a config of something similar to:

autofit-smaller=66%x66%
autofit-larger=90%x90%

Have a screen resolution of e.g. 16:10 1440x900

Have a video of 718x1280

Therefore at the moment, it will be computed like this:

autofit-smaller=950x594
autofit-larger=1296x810
video=718x1280
after-larger=454x810
after-smaller=950x1694

Expected behavior

Either autofit-larger should take precedence, or the option order (of the config file) should be applied.

Actual behavior

The autofit-smaller option always takes precedence over other autofit values, potentially causing portrait videos on landscape screen to exceed screen dimensions (or vice versa)

Easy fix

Swap order in

mpv/video/out/win_state.c

Lines 103 to 105 in f143665

apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit, true, true);
apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit_larger, false, true);
apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit_smaller, true, false);
so autofit_larger gets computed last (takes precedence)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment