Repository navigation
Conversation
segment.time is a media time (it includes @presentationTimeOffset) only when it comes from SegmentTimeline S@t. For SegmentTemplate@duration, SegmentList @duration and the single segment case it starts at 0 at the Period start, so subtracting the offset gave negative presentationTime values. Fixes videojs#197
Author
|
Friendly ping when you have time. Is there anything you'd like changed here? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #197
Problem
segment.timemeans two different things depending on how segments are addressed:SegmentTimeline, it comes fromS@t. That is media time, so it already includes@presentationTimeOffset.@duration(in bothSegmentTemplateandSegmentList), and in the single-segment case,durationTimeParser/parseTemplateInfoset it tonumber * duration(or0). That time starts at 0 at the Period start.segmentTemplate.jsandsegmentList.jssubtracted@presentationTimeOffsetin every case. So@durationsegments came out with negativepresentationTimevalues. For the MPD in the issue that gave-100, -95where it should be0, 5.Fix
Subtract
@presentationTimeOffsetonly when the times come from aSegmentTimeline. Segment URLs ($Number$/$Time$), durations and timelines don't change.Tests
SegmentTemplate@duration, the singleSegmentTemplatesegment, andSegmentList@durationwith a PTO. All three fail onmain.SegmentTimelinetimes still subtract the PTO (template and list).toPlaylists > presentationTime accounts for presentationTimeOffsetcovered the single-segment case and expected the old value (periodStart25, PTO 100 / timescale 4 →0). That segment starts at the Period start, so I changed the expected value to25and renamed the test.npm run build-test && npm run test:node: 201 pass.npm run lint: same 11 existing warnings asmain, 0 errors. I did not run the karma browser suite locally.dist/mpd-parser.cjs.jsnow prints[["f-1.m4s",0],["f-2.m4s",5]].Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.