Skip to content

Commit

Permalink
fix(DASH): Handle minimumUpdatePeriod=0 with urn:mpeg:dash:event:2012…
Browse files Browse the repository at this point in the history
… (EMSG)
  • Loading branch information
avelad committed Oct 27, 2023
1 parent 20b4abf commit 8c0ff5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
4 changes: 2 additions & 2 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,8 @@ shaka.dash.DashParser = class {
// NOTE: An updatePeriod_ of -1 means the attribute was missing.
// An attribute which is present and set to 0 should still result in
// periodic updates. For more, see:
// https://github.com/shaka-project/shaka-player/issues/331
if (this.updatePeriod_ < 0) {
// https://github.com/Dash-Industry-Forum/Guidelines-TimingModel/issues/48
if (this.updatePeriod_ <= 0) {
return;
}

Expand Down
19 changes: 0 additions & 19 deletions test/dash/dash_parser_live_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,25 +661,6 @@ describe('DashParser Live', () => {
expect(delay).toBe(updateTime);
});

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);
const delay = tickAfter.calls.mostRecent().args[0];
expect(delay).toBe(0);
});

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

0 comments on commit 8c0ff5b

Please sign in to comment.