Skip to content

Commit

Permalink
fix: Fix captions not working after a period transition on live DASH …
Browse files Browse the repository at this point in the history
…streams (#3801)

Embedded CEA-608 captions don't work on multi period live DASH DAI streams after new periods appear in the manifest because commas are appended the streams originalId string, which disrupts some stream matching code in text_engine.js

The problem has been resolved by preventing makeTextStreamsForClosedCaptions() from altering the PeriodCombiner.textStreams_ array.

Fixes #3783

Change-Id: I0b99df9cf081a5ad340ac16344f5f0240633d683
  • Loading branch information
caridley authored and joeyparrish committed Jan 5, 2022
1 parent bb7d085 commit f164c62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/util/periods.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ shaka.util.PeriodCombiner = class {

/** @return {!Array.<shaka.extern.Stream>} */
getTextStreams() {
return this.textStreams_;
// Return a copy of the array because makeTextStreamsForClosedCaptions
// may make changes to the contents of the array. Those changes should not
// propagate back to the PeriodCombiner.
return this.textStreams_.slice();
}

/**
Expand Down

0 comments on commit f164c62

Please sign in to comment.