@@ -239,9 +239,6 @@ shaka.dash.DashParser = class {
239
239
this . lowLatencyMode_ = playerInterface . isLowLatencyMode ( ) ;
240
240
this . manifestUris_ = [ uri ] ;
241
241
this . playerInterface_ = playerInterface ;
242
- if ( this . periodCombiner_ ) {
243
- this . periodCombiner_ . setPlayerInterface ( this . playerInterface_ ) ;
244
- }
245
242
246
243
const updateDelay = await this . requestManifest_ ( ) ;
247
244
@@ -684,7 +681,6 @@ shaka.dash.DashParser = class {
684
681
}
685
682
686
683
this . manifestPatchContext_ . type = mpdType ;
687
- this . cleanStreamMap_ ( ) ;
688
684
/** @type {!shaka.media.PresentationTimeline } */
689
685
let presentationTimeline ;
690
686
if ( this . manifest_ ) {
@@ -861,6 +857,8 @@ shaka.dash.DashParser = class {
861
857
// after period combining, while we still have a direct reference, so that
862
858
// any new streams will appear in the period combiner.
863
859
this . playerInterface_ . makeTextStreamsForClosedCaptions ( this . manifest_ ) ;
860
+
861
+ this . cleanStreamMap_ ( ) ;
864
862
}
865
863
866
864
/**
@@ -1504,13 +1502,21 @@ shaka.dash.DashParser = class {
1504
1502
return ! this . lastManifestUpdatePeriodIds_ . includes ( pId ) ;
1505
1503
} ) ;
1506
1504
for ( const pId of diffPeriodsIDs ) {
1505
+ let shouldDeleteIndex = true ;
1507
1506
for ( const contextId of this . indexStreamMap_ [ pId ] ) {
1507
+ const stream = this . streamMap_ [ contextId ] ;
1508
+ if ( stream . segmentIndex && ! stream . segmentIndex . isEmpty ( ) ) {
1509
+ shouldDeleteIndex = false ;
1510
+ continue ;
1511
+ }
1508
1512
if ( this . periodCombiner_ ) {
1509
1513
this . periodCombiner_ . deleteStream ( this . streamMap_ [ contextId ] , pId ) ;
1510
1514
}
1511
1515
delete this . streamMap_ [ contextId ] ;
1512
1516
}
1513
- delete this . indexStreamMap_ [ pId ] ;
1517
+ if ( shouldDeleteIndex ) {
1518
+ delete this . indexStreamMap_ [ pId ] ;
1519
+ }
1514
1520
}
1515
1521
}
1516
1522
0 commit comments