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

Mitigate missing aspect ratio issue #507

Merged

Conversation

MGaetan89
Copy link
Member

@MGaetan89 MGaetan89 commented Apr 23, 2024

Pull request

Description

This PR uses the video size as a fallback when computing the video aspect ratio, when the tracks don't contain the video dimension.
This results in the aspect ratio quickly changing, while loading the first frames, but it still happen a lot less often compared to before #466.

Changes made

  • Try to compute the aspect ratio from the video size, if the tracks don't provide the video dimension.
  • Change the aspect ratio default value back to 1f.
  • Change the methods computing an aspect ratio to return null is the value can not be computed.

Checklist

  • Your branch has been rebased onto the main branch.
  • APIs have been properly documented (if relevant).
  • The documentation has been updated (if relevant).
  • New unit tests have been written (if relevant).
  • The demo has been updated (if relevant).
  • All pull request status checks pass.

@MGaetan89 MGaetan89 linked an issue Apr 23, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Apr 23, 2024

Code Coverage

Overall Project 46.59% -0.29% 🟢
Files changed 1.85% 🟢

Module Coverage
:pillarbox-player 47.18% -0.24% 🟢
:pillarbox-ui 0% -0.71% 🟢
Files
Module File Coverage
:pillarbox-player VideoSize.kt 100% 🟢
PlayerCallbackFlow.kt 78.03% -1.68% 🟢
:pillarbox-ui PlayerSurface.kt 0% -4.68% 🟢

@MGaetan89 MGaetan89 force-pushed the 500-fix-aspect-ratio-when-video-tracks-dont-provide-resolution branch from 6c378f1 to 913441c Compare April 24, 2024 17:53
@MGaetan89 MGaetan89 added this pull request to the merge queue Apr 25, 2024
Merged via the queue into main with commit 63dd699 Apr 25, 2024
10 checks passed
@MGaetan89 MGaetan89 deleted the 500-fix-aspect-ratio-when-video-tracks-dont-provide-resolution branch April 25, 2024 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Fix aspect ratio when video tracks don't provide resolution
2 participants