-
Notifications
You must be signed in to change notification settings - Fork 22
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
osd-dimensions seems to not get loaded in time for align_border #25
Comments
You're probably right that the |
Oh, ok, so this must run on the app launch then and the issue is really launching "too early"? No idea how mpv loads everything and how to control that order, though, but hopefuly you know better :)
Yes, I'm using your suggested defaults in
|
so I found this
and
from https://mpv.io/manual/stable/#script-location Maybe there is a way to get some callback after the subsystem is initialized and call the border align again? |
Yeah so as far as I know there is no guarantee as to the initialization state of the application when the scripts are loaded. We could work around this in a script by simply doing |
I've fixed this in my "single folder" branch by observing the OSD changes and only launching the alignment function when it exists, However, there is still one tiny thing missing: for some reason mpv reports valid OSD twice on launch (non-scaled and scaled) and I'm not sure how to only get the latest change (as I don't want to trigger alignmnt on every OSD change since that would break manual user panning by always reverting to the init alignment). Have more details at this mpv fr, but maybe you have an idea how to get rid of this wrinkle properly? |
I've noticed
The video-pan-y option is out of range: nan
error on launch, which I tracked down to an empty result form this functionmpv-image-viewer/scripts/image-positioning.lua
Line 205 in 9aab900
(this gets invoked from the config
script-message align-border "" -1
call on image load)However, if I map this function to a script keybind and press the key after I've loaded the image, I get correct output (image dimensions)
From this I gather that your script is loaded "too early" or something and not receiving the dimensions, hence it bugs when trying to divide by
0
Do you have an idea what's going on here and how to fix it?
Or maybe it's the next line
if not dim then return end
that bugs and let's troughdim
with 0 values? Then a simpleif not dim.w then return end
fix would work, but then I'm not sure I understand the logic: is this call supposed to happen when you launch the app (so zero dimensions are a bug) or is it only meant for later image loads (then it's ok for thedim
to be empty on launch), but not the first one?mpv-image-viewer/scripts/image-positioning.lua
Line 206 in 9aab900
Using mpv 0.35 on a macOS
The text was updated successfully, but these errors were encountered: