From 6e0737ec25c14a1566cbb1dd8662ed6abf527670 Mon Sep 17 00:00:00 2001 From: Aidan Ridley Date: Mon, 13 Dec 2021 15:22:47 -0700 Subject: [PATCH] Fix #3783 captions not working after a period transition on live DASH 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 --- lib/util/periods.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/util/periods.js b/lib/util/periods.js index ec15872c6a..e88fac2475 100644 --- a/lib/util/periods.js +++ b/lib/util/periods.js @@ -80,7 +80,10 @@ shaka.util.PeriodCombiner = class { /** @return {!Array.} */ 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(); } /** @return {!Array.} */