File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -4277,6 +4277,10 @@ shaka.hls.HlsParser = class {
4277
4277
item . tags , 'EXT-X-DISCONTINUITY' ) ;
4278
4278
if ( discontinuityTag ) {
4279
4279
discontinuitySequence ++ ;
4280
+
4281
+ if ( previousReference && previousReference . initSegmentReference ) {
4282
+ previousReference . initSegmentReference . boundaryEnd = startTime ;
4283
+ }
4280
4284
}
4281
4285
4282
4286
// Apply new AES tags as you see them, keeping a running total.
Original file line number Diff line number Diff line change @@ -3045,17 +3045,26 @@ shaka.media.StreamingEngine = class {
3045
3045
const mediaState = this . mediaStates_ . get ( ContentType . VIDEO ) ||
3046
3046
this . mediaStates_ . get ( ContentType . AUDIO ) ;
3047
3047
3048
- if ( ! mediaState || ! mediaState . lastAppendWindowEnd ||
3049
- mediaState . clearingBuffer ) {
3048
+ if ( ! mediaState || mediaState . clearingBuffer ) {
3050
3049
return ;
3051
3050
}
3052
3051
3052
+ const lastInitRef = mediaState . lastInitSegmentReference ;
3053
+ if ( ! lastInitRef ) {
3054
+ return ;
3055
+ }
3056
+
3057
+ const boundaryEnd = lastInitRef . boundaryEnd ;
3058
+ if ( boundaryEnd == null ) {
3059
+ return ;
3060
+ }
3053
3061
const threshold = shaka . media . StreamingEngine . CROSS_BOUNDARY_END_THRESHOLD_ ;
3054
- const fromEnd = mediaState . lastAppendWindowEnd - presentationTime ;
3062
+ const fromEnd = boundaryEnd - presentationTime ;
3055
3063
// Check if greater than 0 to eliminate a backwards seek.
3056
3064
if ( fromEnd > 0 && fromEnd < threshold ) {
3057
3065
// Set the intended time to seek to in order to cross the boundary.
3058
- this . boundaryTime_ = mediaState . lastAppendWindowEnd ;
3066
+ this . boundaryTime_ = boundaryEnd +
3067
+ shaka . media . StreamingEngine . APPEND_WINDOW_END_FUDGE_ ;
3059
3068
3060
3069
if ( immediate ) {
3061
3070
this . crossBoundaryTimer_ . tickNow ( ) ;
You can’t perform that action at this time.
0 commit comments