@@ -173,6 +173,7 @@ shaka.dash.SegmentTemplate = class {
173
173
174
174
shaka . log . debug ( `Creating TSI with end ${ periodEnd } ` ) ;
175
175
segmentIndex = new TimelineSegmentIndex (
176
+ context . dynamic ,
176
177
info ,
177
178
context . representation . originalId ,
178
179
context . bandwidth ,
@@ -188,7 +189,8 @@ shaka.dash.SegmentTemplate = class {
188
189
} else {
189
190
const tsi = /** @type {!TimelineSegmentIndex } */ ( segmentIndex ) ;
190
191
tsi . appendTemplateInfo (
191
- info , periodStart , periodEnd , initSegmentReference ) ;
192
+ info , periodStart , periodEnd , initSegmentReference ,
193
+ context . dynamic ) ;
192
194
193
195
const availabilityStart =
194
196
context . presentationTimeline . getSegmentAvailabilityStart ( ) ;
@@ -232,7 +234,7 @@ shaka.dash.SegmentTemplate = class {
232
234
if ( segmentIndex instanceof shaka . dash . TimelineSegmentIndex &&
233
235
segmentIndex . isEmpty ( ) ) {
234
236
segmentIndex . appendTemplateInfo ( info , periodStart ,
235
- periodEnd , initSegmentReference ) ;
237
+ periodEnd , initSegmentReference , context . dynamic ) ;
236
238
}
237
239
return Promise . resolve ( segmentIndex ) ;
238
240
} ,
@@ -778,7 +780,7 @@ shaka.dash.SegmentTemplate = class {
778
780
*/
779
781
shaka . dash . TimelineSegmentIndex = class extends shaka . media . SegmentIndex {
780
782
/**
781
- *
783
+ * @param { boolean } dynamic
782
784
* @param {!shaka.dash.SegmentTemplate.SegmentTemplateInfo } templateInfo
783
785
* @param {?string } representationId
784
786
* @param {number } bandwidth
@@ -791,11 +793,14 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
791
793
* @param {number } segmentSequenceCadence
792
794
* @param {number } timeline
793
795
*/
794
- constructor ( templateInfo , representationId , bandwidth , getBaseUris ,
796
+ constructor ( dynamic , templateInfo , representationId , bandwidth , getBaseUris ,
795
797
urlParams , periodStart , periodEnd , initSegmentReference ,
796
798
aesKey , segmentSequenceCadence , timeline ) {
797
799
super ( [ ] ) ;
798
800
801
+ /** @private {boolean} */
802
+ this . dynamic_ = dynamic ;
803
+
799
804
/** @private {?shaka.dash.SegmentTemplate.SegmentTemplateInfo} */
800
805
this . templateInfo_ = templateInfo ;
801
806
@@ -897,9 +902,12 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
897
902
* @param {number } periodStart
898
903
* @param {number } periodEnd
899
904
* @param {shaka.media.InitSegmentReference } initSegmentReference
905
+ * @param {boolean } dynamic
900
906
*/
901
- appendTemplateInfo ( info , periodStart , periodEnd , initSegmentReference ) {
907
+ appendTemplateInfo ( info , periodStart , periodEnd , initSegmentReference ,
908
+ dynamic ) {
902
909
this . updateInitSegmentReference ( initSegmentReference ) ;
910
+ this . dynamic_ = dynamic ;
903
911
if ( ! this . templateInfo_ ) {
904
912
this . templateInfo_ = info ;
905
913
this . periodStart_ = periodStart ;
@@ -1091,7 +1099,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
1091
1099
if ( correctedPosition === this . getNumReferences ( ) - 1 &&
1092
1100
this . periodEnd_ !== Infinity ) {
1093
1101
// See https://github.com/shaka-project/shaka-player/issues/8672
1094
- if ( Math . abs ( segmentEnd - this . periodEnd_ ) > 0.1 ) {
1102
+ if ( this . dynamic_ && Math . abs ( segmentEnd - this . periodEnd_ ) > 0.1 ) {
1095
1103
segmentEnd = Math . min ( segmentEnd , this . periodEnd_ ) ;
1096
1104
} else {
1097
1105
segmentEnd = this . periodEnd_ ;
0 commit comments