Skip to content
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

Auto resize issue with video size equal or bigger than screen resolution v.2 #9723

Closed
maniak1349 opened this issue Jan 18, 2022 · 8 comments
Closed
Labels

Comments

@maniak1349
Copy link
Contributor

Important Information

  • Build : mpv 0.34.0-142-g1ba0547bfb by shinchiro
  • Windows 7 x64
  • Source of the mpv binary: shinchiro build on sourceforge via mpv.io -> installation -> Windows
  • Version that introduced the problem: unknown? (see additional info) Previously used version is 0.24

Reproduction steps

Play a video with size bigger or equal to screen size. Screen width in this case.

Expected behavior

Actual video being fit to screen. At least with appropriate option enabled.

Actual behavior

Whole window is fit to screen including borders.

Log file

mpv_n.log

Additional information

--no-fit-border option was added to deal precisely with this issue. Option removed with this commit. Original issue.

@maniak1349
Copy link
Contributor Author

Got some time to dig around. It seems that aside from mentioned commit nothing else was done. Option and its effect were just removed because person who did it thought it was a bug, probably because of somewhat misleading description. But the general rule for manual is to describe a prefixless option, and prefixless option is exactly that - its on by default and does nothing. That's why I have described effect of --no-fit-border in description too, but it seems it did not help, so maybe manual entry should be rephrased or option should be renamed somehow.

@jimmy-1000
Copy link

I don't understand. Why don't you post some screen captures?

@maniak1349
Copy link
Contributor Author

I want this
old
not this
current

@jimmy-1000
Copy link

So you do not want left and right border? Oh. That is what fullscreen for left and right in youtube does. Okay.

I still don't understand what this guy want 😁

@Hrxn
Copy link
Contributor

Hrxn commented Feb 6, 2022

You're not alone.

@avih
Copy link
Member

avih commented Feb 7, 2022

Expected behavior

Actual video being fit to screen. At least with appropriate option enabled.

Actual behavior

Whole window is fit to screen including borders.

First of all, let's put this in context, the only difference between what you expect and the actual behavior is that the maximum size of the initial automatic fit is few pixels smaller so that the borders are visible. You can still resize it manually to whatever width/height which Windows allows.

Now, what you want/expect is not always possible, for instance Windows doesn't allow the content to touch or even get near the upper edge of the screen - Windows itself moves the window down so that the title bar becomes fully visible (vertically). You can try it yourself - try to move any window up so that the title is partially outside the screen - Windows moves it back down.

This makes it impossible to always make the "Actual video being fit to screen" when borders are enabled.

The --fit-border option was broken in some cases exactly because it assumed (incorrectly) that what you want is possible - that the content area could be the entire screen area - but Windows simply doesn't allow that. Even if mpv tries to set the content height to the exact screen height, and even if Windows wasn't moving the window down to fit the title bar (which will make the bottom of the content below the screen) - it still refused to set such a big content area. This resulted in an actual window size smaller (not as tall) than requested, and this resulted in various miscalculations and incorrect fit, in addition to some of the content area ending up below/outside the screen.

So this is why this option was removed (became no-op). It was broken in several ways when it needed to fit the video height to the screen height.

It's true that seemingly Windows does allow the content width to be the same as the screen width (with side borders outside the screen, like at your first screenshot), and it's true that --fit-border=no did seem to work correctly when only the width needed to fit. However, mpv has no real way to measure what's the maximum area which Windows allows so that the content is fully visible.

So the only safe bet is to calculate the size such that the decorations fit inside the screen too. This is also logically correct, because when borders are enabled then mpv places a window on screen, and for that window to be usable normally (e.g. resize by dragging a side-border) the borders need to be inside the screen.

With borders enabled mpv simply doesn't know how many more pixels it can squeeze - without Windows later quietly adjusting the size/position on its own due to internal Windows limits - which will break the fit.

Today Windows seem to allow the content to touch the sides and bottom of the screen edges - but not the top edge - it WILL shrink/move the content area vertically on its own. Tomorrow it might not allow the sides and/or bottom either - and maybe resize quietly on its own so that all the borders are visible - and break the automatic fit.

So the only safe way to make the content touch the screen edges is to disable the borders (or fullscreen, or maximize where currently Windows makes the content sides and bottom touch the screen edges). If you enable the borders then mpv does the safe and reasonable thing and places them inside the screen.

If/when someone finds a way to query the exact maximum size/position request which Windows allows - we can bring this option back. Till then - mpv does the safe thing.

@avih avih closed this as completed Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@avih @maniak1349 @Hrxn @jimmy-1000 and others