Skip to content

Fix: Align destination width to 32 for hardware decoder compatibility #29

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spiderpigpig
Copy link

  • Modified the calculation of dw to use FFALIGN(sw, 32) instead of sw >> 2 << 2.
  • Ensured that the destination width is aligned to a multiple of 32, which improves compatibility with hardware decoders (e.g., h264_cuvid).
  • This change resolves potential crashes caused by misaligned resolutions when using sws_scale.

Related logs:

  • Original resolution (888x550) caused crashes due to unaligned width.
  • After alignment, the issue was resolved and the program runs stably."

- Modified the calculation of `dw` to use `FFALIGN(sw, 32)` instead of `sw >> 2 << 2`.
- Ensured that the destination width is aligned to a multiple of 32, which improves compatibility with hardware decoders (e.g., h264_cuvid).
- This change resolves potential crashes caused by misaligned resolutions when using `sws_scale`.

Related logs:
- Original resolution (888x550) caused crashes due to unaligned width.
- After alignment, the issue was resolved and the program runs stably."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant