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

[subtitles][libass] add fallback value for no PlayRes #25877

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

CastagnaIT
Copy link
Collaborator

@CastagnaIT CastagnaIT commented Oct 25, 2024

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

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • Student submission (PR was done for educational purposes and will be treated as such)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue Backport: Needed WIP PR that is still being worked on v22 Piers labels Oct 25, 2024
@CastagnaIT CastagnaIT added this to the Piers 22.0 Alpha 1 milestone Oct 25, 2024
@CastagnaIT CastagnaIT mentioned this pull request Oct 25, 2024
14 tasks
@CastagnaIT CastagnaIT removed the WIP PR that is still being worked on label Oct 25, 2024
@CastagnaIT CastagnaIT marked this pull request as ready for review October 25, 2024 15:36
@CastagnaIT CastagnaIT merged commit ed18120 into xbmc:master Oct 26, 2024
2 checks passed
@CastagnaIT CastagnaIT deleted the fix_libass_playres branch October 26, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video with external ass subtitle + Override Subtitles Fonts will result in wrong position of subtitle
2 participants