From 1515b7abf62a9e7227d428d0a90c303e7aecc45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 13 Jun 2023 01:19:58 +0200 Subject: [PATCH] feat(DASH): Remove MIN_UPDATE_PERIOD_ to achieve better latency in Live (#5286) Many LL streams use 2 seconds segments, so we have to ensure that these streams work correctly. --- lib/dash/dash_parser.js | 11 ----------- test/dash/dash_parser_live_unit.js | 6 ++---- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/dash/dash_parser.js b/lib/dash/dash_parser.js index f08a27e822..25325a0ff0 100644 --- a/lib/dash/dash_parser.js +++ b/lib/dash/dash_parser.js @@ -1416,7 +1416,6 @@ shaka.dash.DashParser = class { } const finalDelay = Math.max( - shaka.dash.DashParser.MIN_UPDATE_PERIOD_, this.updatePeriod_ - offset, this.averageUpdateDuration_.getEstimate()); @@ -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., ?number, ?number, boolean): diff --git a/test/dash/dash_parser_live_unit.js b/test/dash/dash_parser_live_unit.js index 93da3225c5..6420aad36a 100644 --- a/test/dash/dash_parser_live_unit.js +++ b/test/dash/dash_parser_live_unit.js @@ -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 () => { @@ -701,8 +700,7 @@ describe('DashParser Live', () => { '', ]; 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;