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

perf(Xbox): drop incompatible variants for XBOX early #5777

Conversation

vanyaxk
Copy link
Contributor

@vanyaxk vanyaxk commented Oct 17, 2023

This change:

  • drops incompatible variants for XBOX before parsing codes and checking them against media capabilities API
  • avoids redeclaring variables each time in the loop

@shaka-bot
Copy link
Collaborator

shaka-bot commented Oct 17, 2023

Incremental code coverage: 83.33%

@avelad avelad changed the title refactor(xbox): drop incompatible variants for XBOX early perf(xbox): drop incompatible variants for XBOX early Oct 18, 2023
@avelad avelad changed the title perf(xbox): drop incompatible variants for XBOX early perf(Xbox): drop incompatible variants for XBOX early Oct 18, 2023
@avelad avelad added type: performance A performance issue priority: P1 Big impact or workaround impractical; resolve before feature release platform: Xbox Issues affecting Xbox labels Oct 18, 2023
@avelad avelad added this to the v4.6 milestone Oct 18, 2023
Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good otherwise. Thanks!

// See: https://github.com/shaka-project/shaka-player/issues/3380
// Note: it makes sense to drop early
if (isXboxOne && video &&
((video.width && video.width > 1920) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If width is null or undefined, it will not be > 1920. Please drop the "truthy" checks on width and height and combine width > 1920 || height > 1080 on one line if possible, to make this long sequence of booleans more readable.

Also, these continuations should be indented +2 from where they are now. That will also make them easier to differentiate from the log inside the if(). Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, the compiler had a problem with that change, but I added dimension variables to make sure the type is right - hope that's OK

lib/util/stream_utils.js Outdated Show resolved Hide resolved
@joeyparrish joeyparrish merged commit 170a40c into shaka-project:main Oct 18, 2023
15 checks passed
Robloche pushed a commit to Robloche/shaka-player that referenced this pull request Nov 30, 2023
…5777)

This change:

- drops incompatible variants for XBOX before parsing codes and checking them against media capabilities API
- avoids redeclaring variables each time in the loop

Co-authored-by: Ivan Kohut <ivan.kohut@lamin.ar>
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Dec 17, 2023
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: Xbox Issues affecting Xbox priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: performance A performance issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants