Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor streams playback start #3308

Merged

Conversation

bbert
Copy link
Contributor

@bbert bbert commented Jun 24, 2020

This PR intends to refactor and simplify streams playback start process:

  • always use seeking process from PlaybackController to seek controllersevent for initial playback start
  • adjust seek time in BufferController according to effective appended ranges (in case of misalignement between manifest and coded fragments)

The changes are illustrated in following sequence diagram: https://sketchboard.me/nCcqJmksDzlb#/

@bbert
Copy link
Contributor Author

bbert commented Jun 24, 2020

Thanks to this PR, use cases as described in issue #3146 are correctly handled
Feedback and tests are welcome, especially for multi-periods streams to ensure there is no regression

@dsilhavy dsilhavy self-requested a review June 24, 2020 14:08
@dsilhavy dsilhavy added this to the 3.1.2 milestone Jun 24, 2020
let startTime = streamSeekTime;
if (isNaN(startTime)) {
startTime = isDynamic ? e.liveStartTime : e.streamInfo.start;
startTime = Math.max(startTime, getStartTimeFromUri());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up the discussion we had on Slack and using #t during startup: Using #t for live will not work with dynamic manifests as the live edge will always have a higher value than the #t. I think it should be Math.min but we need to consider the DVR window at this point. If #t is out of the DVR window we can either ignore it or adjust its value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addition: For Math.min for live, Math.max for VoD

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getStartTimeFromUri() should return NaN instead of -1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, getStartTimeFromUri() should not return NaN
Math.max and Math.min are expecting each parameter to ba a valid number
Math.max(x, NaN) and Math.min(x, NaN) return NaN

But I do modify acording your remarks and take advantage of this PR to make code conformed to MPD anchors spec

Bertrand Berthelot added 9 commits June 29, 2020 11:29
- always use seeking process from PlaybackController to seek controllers
- adjust seek time in BufferController according to effective appended ranges
- ScheduleController: do not stop scheduler when updating data (at manifest updates)
@dsilhavy
Copy link
Collaborator

As discussed on Slack, tested:

VoD

  • #t set to value within timeline #t=40 : Pass
  • #t set to negative value #t=-10 : Pass
  • #t set to value larger than duration #t=999999 : Pass
  • #t set to string #t=adbc : Pass
  • #t using different starting period #t=40&period=1 : Not yet supported
  • #t using different starting track #t=40&track=en51: Not yet supported
  • #t with range #t=60,180: Start time is correct, range limited to 180: Not supported yet
  • #t as posix value #t=posix:60: Pass, ignored for VoD

Live

  • #t set to value within dvr window #t= 1593505002 : Pass
  • #t set to value out of timeline #t=40 : Pass, starts at DVRWindow.start.
  • #t set to negative value #t=-10 : Pass, starts at DVRWindow.start.
  • #t set to value larger than duration #t=99999999999 : Pass, starts at live edge
  • #t set to string #t=adbc : Pass, starts at live edge
  • #t as posix value #t=posix:1593502992: Pass
  • #t as invalid low posix value #t=posix:12: Pass, starts at DVRWindow.start
  • #t as invalid high posix value #t=posix:15935050029999: Pass, starts at live edge
  • #t set to now: #t=now : Pass, starts at live edge

it('should start static stream at period start if #t is beyond period end', function (done) {
doneFn = done;

let uriStartTime = 700;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to define this as staticStreamInfo.duration + 100 in case we ever change the value in staticStreamInfo.duration

@dsilhavy dsilhavy merged commit 4c2baba into Dash-Industry-Forum:development Jun 30, 2020
jeffcunat pushed a commit to Orange-OpenSource/dash.js that referenced this pull request Jul 6, 2020
* Refactor stream playback starting process:
- always use seeking process from PlaybackController to seek controllers
- adjust seek time in BufferController according to effective appended ranges
- ScheduleController: do not stop scheduler when updating data (at manifest updates)

* revert gap/discontinuity limit for buffer range tolerance (to do in another PR)

* update code comments

* BufferController: optimise effective range seeking if seek target

* avoid seeking at NaN

* remove commented code

* remove commented code

* Add processing of MPD time anchor (#t) according to Annex C of MPEG DASH spec

* StreamProcessor: update DVR info metrics also if SEGMENTS_UPDATE_FAILED_ERROR_CODE

* rename getStartTimeFromUriParameters() parameter to 'rangeStart'

* Start at DVR window start if #t is before DVR window range

* Ignore #t=posix: notation for static streams

* #t=<time> shall be relative to period start for dynamic streams

* update unit tests
@bbert bbert mentioned this pull request Jul 7, 2020
@bbert bbert deleted the stream-playback-start branch August 17, 2020 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants