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

presentationTimeOffset in SegmentBase is interpreted in seconds instead of time units #1099

Closed
kqyang opened this issue Oct 31, 2017 · 3 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@kqyang
Copy link
Contributor

kqyang commented Oct 31, 2017

Have you read the FAQ and checked for duplicate issues: YES

What version of Shaka Player are you using: Latest

Can you reproduce the issue with our latest release version: YES

Can you reproduce the issue with the latest code from master: YES

Are you using the demo app or your own custom app: Demo

What browser and OS are you using: Chrome on Linux

What are the manifest and license server URIs:

https://storage.googleapis.com/wvtemp/shaka/bourne/bourne_audio_pto_20.mpd
https://storage.googleapis.com/wvtemp/shaka/bourne/bourne_audio_pto_4410.mpd

What did you do?

Play the above manifests in Shaka demo player.

What did you expect to happen?

https://storage.googleapis.com/wvtemp/shaka/bourne/bourne_audio_pto_20.mpd
The audio should start playing from 20/44100 in media timeline. However, it starts from 20 seconds instead.

https://storage.googleapis.com/wvtemp/shaka/bourne/bourne_audio_pto_4410.mpd
The audio should start playing from 4410/44100 = 0.1 seconds in media timeline. However, the player returns "segment_index.js:240 The last segment should not end before the end of the Period." instead.

Here is the relevant clause of presentationTimeOffset in the spec:

ISO/IEC 23009-1:2014 5.3.9.2 Segment base information

@presentationTimeOffset specifies the presentation time offset of the Representation relative to the start of the Period, i.e. the presentation time value of the media stream that shall be presented at the start of this Period.

The value of the presentation time offset in seconds is the division of the value of this attribute and the value of the @timescale attribute.

@kqyang kqyang changed the title presentationTimeOffset in SegmentBase is interpreted incorrectly presentationTimeOffset in SegmentBase is interpreted in seconds instead of time units Oct 31, 2017
@kqyang
Copy link
Contributor Author

kqyang commented Oct 31, 2017

Just realized that a similar issue has just been filed: #1098

@joeyparrish joeyparrish self-assigned this Nov 1, 2017
@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Nov 1, 2017
@joeyparrish joeyparrish added this to the v2.3.0 milestone Nov 1, 2017
@joeyparrish
Copy link
Member

A brief review of DASH parser from v1 makes me think we didn't have this bug in v1.

In v2 (all versions), we seem to parse SegmentTemplate and SegmentTimeline correctly and divide by timescale, but not SegmentBase. So the damage is limited to SegmentBase's presentationTimeOffset, but the bug seems to be present in every single v2 release, all the way back to v2.0.0-beta.

joeyparrish added a commit that referenced this issue Nov 1, 2017
In DASH SegmentBase, we were not dividing presentationTimeOffset by
the timescale.  In all other instances of presentationTimeOffset in
DASH, we were handling it correctly.

This bug was present in all v2 releases until now.

The solution is not only to divide by timescale, but to rename all
internal uses of presentationTimeOffset to either unscaled or scaled,
to differentiate between those in timescale units and those in
seconds.  I believe inconsistent naming and units were a contributing
factor to the creation of the bug.

Closes #1099

Change-Id: Id561f8eb1f5bc011c606e1925c12f0d8183fd51a
joeyparrish added a commit that referenced this issue Nov 1, 2017
In DASH SegmentBase, we were not dividing presentationTimeOffset by
the timescale.  In all other instances of presentationTimeOffset in
DASH, we were handling it correctly.

This bug was present in all v2 releases until now.

The solution is not only to divide by timescale, but to rename all
internal uses of presentationTimeOffset to either unscaled or scaled,
to differentiate between those in timescale units and those in
seconds.  I believe inconsistent naming and units were a contributing
factor to the creation of the bug.

Closes #1099

Minimal cherry-pick of the original fix from v2.2.x
@joeyparrish
Copy link
Member

The fix has been cherry-picked for v2.2.5 and v2.1.9.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants