Skip to content

Commit

Permalink
fix: Fix key rotation in DASH
Browse files Browse the repository at this point in the history
This was broken accidentally during MediaCapabilities refactoring.
This does not affect any release version.

The filtering step does two things: it applys the "restrictions"
config to the streams in the manifest, and it sends DRM init data to
DrmEngine for all streams in case new sessions need to be created.

For key rotation, it is critical to create new sessions in DrmEngine.
The init datas for new periods are added to existing streams when the
new period's streams are stitched onto the old ones.

The restrictions config should also be applied on manifest update,
since the update could have created some new streams with
characteristics outside of the current restrictions config.

Closes shaka-project#3169

Change-Id: I716c2978c7394d7bb56227aa1854392a10eae058
  • Loading branch information
joeyparrish committed Apr 21, 2021
1 parent 29e7ab1 commit 6143a6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/dash/dash_parser.js
Expand Up @@ -485,6 +485,11 @@ shaka.dash.DashParser = class {
this.manifest_.variants = this.periodCombiner_.getVariants();
this.manifest_.textStreams = this.periodCombiner_.getTextStreams();
this.manifest_.imageStreams = this.periodCombiner_.getImageStreams();

// Re-filter the manifest. This will check any configured restrictions on
// new variants, and will pass any new init data to DrmEngine to ensure
// that key rotation works correctly.
this.playerInterface_.filter(this.manifest_);
}

// Add text streams to correspond to closed captions. This happens right
Expand Down

0 comments on commit 6143a6d

Please sign in to comment.