From a5a4d3e47c14f2b52c3d43dd21640a5992d20641 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Fri, 10 Mar 2023 21:31:18 -0800 Subject: [PATCH] fix(HLS): preserve discontinuitySequence in SegmentIndex#fit (#5066) The `discontinuitySequence` field of the last `SegmentReference` was getting reset to `0` in this function, even if it was originally set to something other than 0. This was causing unnecessary resyncs for the final segment of the video in sequence mode. --- lib/media/segment_index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/media/segment_index.js b/lib/media/segment_index.js index bad96a0343..544d9bd7b9 100644 --- a/lib/media/segment_index.js +++ b/lib/media/segment_index.js @@ -363,6 +363,8 @@ shaka.media.SegmentIndex = class { lastReference.status, lastReference.hlsAes128Key, ); + this.references[this.references.length - 1].discontinuitySequence = + lastReference.discontinuitySequence; }