Skip to content

Commit

Permalink
fix(DASH): Update dash manifest when minimumUpdatePeriod = 0 (#6187)
Browse files Browse the repository at this point in the history
Fixes #6185

Backported to v4.3.x
  • Loading branch information
Iragne authored and joeyparrish committed Feb 17, 2024
1 parent b6adc09 commit 2e2767e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dash/dash_parser.js
Expand Up @@ -1442,7 +1442,7 @@ shaka.dash.DashParser = class {
// An attribute which is present and set to 0 should still result in
// periodic updates. For more, see:
// https://github.com/Dash-Industry-Forum/Guidelines-TimingModel/issues/48
if (this.updatePeriod_ <= 0) {
if (this.updatePeriod_ < 0) {
return;
}

Expand Down
17 changes: 17 additions & 0 deletions test/dash/dash_parser_live_unit.js
Expand Up @@ -607,6 +607,23 @@ describe('DashParser Live', () => {
expect(onError).toHaveBeenCalledTimes(1);
});

it('still updates when @minimumUpdatePeriod is zero', async () => {
const lines = [
'<SegmentTemplate startNumber="1" media="s$Number$.mp4" duration="2" />',
];
// updateTime parameter sets @minimumUpdatePeriod in the manifest.
const manifestText = makeSimpleLiveManifestText(lines, /* updateTime= */ 0);

/** @type {!jasmine.Spy} */
const tickAfter = updateTickSpy();
Date.now = () => 0;

fakeNetEngine.setResponseText('dummy://foo', manifestText);
await parser.start('dummy://foo', playerInterface);

expect(tickAfter).toHaveBeenCalledTimes(1);
});

it('uses @minimumUpdatePeriod', async () => {
const lines = [
'<SegmentTemplate startNumber="1" media="s$Number$.mp4" duration="2" />',
Expand Down

0 comments on commit 2e2767e

Please sign in to comment.