Skip to content

Commit

Permalink
feat(DASH): Remove MIN_UPDATE_PERIOD_ to achieve better latency in Li…
Browse files Browse the repository at this point in the history
…ve (shaka-project#5286)

Many LL streams use 2 seconds segments, so we have to ensure that these
streams work correctly.
  • Loading branch information
avelad committed Jun 12, 2023
1 parent 9f80e3c commit 1515b7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
11 changes: 0 additions & 11 deletions lib/dash/dash_parser.js
Expand Up @@ -1416,7 +1416,6 @@ shaka.dash.DashParser = class {
}

const finalDelay = Math.max(
shaka.dash.DashParser.MIN_UPDATE_PERIOD_,
this.updatePeriod_ - offset,
this.averageUpdateDuration_.getEstimate());

Expand Down Expand Up @@ -1900,16 +1899,6 @@ shaka.dash.DashParser = class {
};


/**
* Contains the minimum amount of time, in seconds, between manifest update
* requests.
*
* @private
* @const {number}
*/
shaka.dash.DashParser.MIN_UPDATE_PERIOD_ = 3;


/**
* @typedef {
* function(!Array.<string>, ?number, ?number, boolean):
Expand Down
6 changes: 2 additions & 4 deletions test/dash/dash_parser_live_unit.js
Expand Up @@ -673,10 +673,9 @@ describe('DashParser Live', () => {
fakeNetEngine.setResponseText('dummy://foo', manifestText);
await parser.start('dummy://foo', playerInterface);

const waitTime = shaka.dash.DashParser['MIN_UPDATE_PERIOD_'];
expect(tickAfter).toHaveBeenCalledTimes(1);
const delay = tickAfter.calls.mostRecent().args[0];
expect(delay).toBe(waitTime);
expect(delay).toBe(0);
});

it('does not update when @minimumUpdatePeriod is missing', async () => {
Expand All @@ -701,8 +700,7 @@ describe('DashParser Live', () => {
'<SegmentTemplate startNumber="1" media="s$Number$.mp4" duration="2" />',
];
const extraWaitTime = 15.0;
const idealUpdateTime = shaka.dash.DashParser['MIN_UPDATE_PERIOD_'];
const manifestText = makeSimpleLiveManifestText(lines, idealUpdateTime);
const manifestText = makeSimpleLiveManifestText(lines, 3);

let now = 0;
Date.now = () => now;
Expand Down

0 comments on commit 1515b7a

Please sign in to comment.