Skip to content

Commit

Permalink
fix(HLS): Fix seekRange when using delta playlist (#6758)
Browse files Browse the repository at this point in the history
Only happens when we use `useSafariBehaviorForLive = false`.
  • Loading branch information
avelad authored Jun 5, 2024
1 parent 8d7dd37 commit 7bcb86e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ shaka.hls.HlsParser = class {
mediaSequenceNumber);
stream.segmentIndex.evict(playlistStartTime);
}
const oldSegment = segments[0];
const oldSegment = stream.segmentIndex.earliestReference();
goog.asserts.assert(oldSegment, 'Should have segments!');

streamInfo.minTimestamp = oldSegment.startTime;
Expand Down
8 changes: 6 additions & 2 deletions test/hls/hls_live_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,8 @@ describe('HlsParser live', () => {
'#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=60.0,\n',
'#EXT-X-SKIP:SKIPPED-SEGMENTS=1\n',
'#EXTINF:2,\n',
'main1.mp4\n',
'#EXTINF:2,\n',
'main2.mp4\n',
].join('');

Expand All @@ -1121,14 +1123,16 @@ describe('HlsParser live', () => {
'#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=60.0,\n',
'#EXT-X-SKIP:SKIPPED-SEGMENTS=1\n',
'#EXTINF:2,\n',
'main2.mp4\n',
'#EXTINF:2,\n',
'main3.mp4\n',
].join('');

fakeNetEngine.setResponseText(
'test:/video?_HLS_msn=2&_HLS_skip=YES', mediaWithSkippedSegments1);

fakeNetEngine.setResponseText(
'test:/video?_HLS_msn=3&_HLS_skip=YES', mediaWithSkippedSegments2);
'test:/video?_HLS_msn=4&_HLS_skip=YES', mediaWithSkippedSegments2);

playerInterface.isLowLatencyMode = () => true;

Expand All @@ -1145,7 +1149,7 @@ describe('HlsParser live', () => {

await delayForUpdatePeriod();
fakeNetEngine.expectRequest(
'test:/video?_HLS_msn=3&_HLS_skip=YES',
'test:/video?_HLS_msn=4&_HLS_skip=YES',
shaka.net.NetworkingEngine.RequestType.MANIFEST,
{type:
shaka.net.NetworkingEngine.AdvancedRequestType.MEDIA_PLAYLIST});
Expand Down

0 comments on commit 7bcb86e

Please sign in to comment.