[subtitles][libass] add fallback value for no PlayRes #25877
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
User provided a .ass subtitle without PlayResX / PlayResY values that usually must be provided
since the value is 0, cause a wrong behaviour in the scaling calculations
the calculated fallbacks values for PlayResX / PlayResY are specified here
https://github.com/libass/libass/blob/6a759836e5e76bb7b69b0ac244eea76b0d290512/libass/ass.c#L1782-L1795
since they are verified only when libass redering start, we cant get the corrected values
the fix consist in the imitate the libass sources behaviours and print to the log when this happens
i choosen to not copy libass sources 1:1 because has not much sense if the upstream change in future
Motivation and context
fix #23481
How has this been tested?
you can use test.zip
with any mkv with same file name
then enable/disable fonts override sub setting
What is the effect on users?
show text in the right place and not on top/outside of the screen
Screenshots (if appropriate):
Types of change
Checklist: