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

feat: Cache mediaCapabilities.decodingInfo results #4789

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

theodab
Copy link
Collaborator

@theodab theodab commented Dec 5, 2022

Issue #4775

@theodab theodab added the type: enhancement New feature or request label Dec 5, 2022
@avelad avelad added this to the v4.4 milestone Dec 5, 2022
@avelad avelad added the priority: P2 Smaller impact or easy workaround label Dec 5, 2022
avelad
avelad previously approved these changes Dec 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

Incremental code coverage: 100.00%

@theodab theodab merged commit b7781f0 into shaka-project:main Dec 6, 2022
@theodab theodab deleted the mcapCache branch December 6, 2022 02:12
*/
static async getDecodingInfosForVariant_(variant, decodingConfig) {
try {
const cacheKey = JSON.stringify(decodingConfig);
Copy link
Member

Choose a reason for hiding this comment

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

This is a problematic key. If the fields are serialized in a different order, this will fail to match.

It's better than no caching, but this needs work. Please file an issue to follow-up on this.

Copy link
Member

Choose a reason for hiding this comment

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

(There's an entire ToTT episode on this subject, BTW, in context of comparing objects in tests using JSON.stringify. But it still applies here.)

* (stringified) decodingConfig.
*
* @type {Object.<(!string), (!MediaCapabilitiesDecodingInfo)>}
* @export
Copy link
Member

Choose a reason for hiding this comment

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

Why is this exported? I don't think we want this exposed to the application and subject to backward compatibility guarantees.

If you just need it for unit testing, use @suppress in a test helper instead.

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants