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

Fix raw duration computation when 'default_sample_duration' field is … #2625

Conversation

adrian-branescu
Copy link

…present in the moof fragment

This PR will...

Fix bug that corrupts DTS & PTS for HLS fMP4 streams that have the 'default_sample_duration' field present inside the moof fragments.

This bug triggers a chain of problems that make impossible to buffer and play these kind of streams.

Checklist

  • changes have been done against feature/v1.0.0 branch, and PR does not conflict

@adrian-branescu
Copy link
Author

Hi @robwalch can you please take a look at this PR?
It's just a line modified from feature/v1.0.0 branch but the bug is blocker to me. 😢

@@ -342,7 +342,7 @@ export function getDuration (data, initData) {
sampleDuration = readUint32(tfhd, 8);
}
const sampleCount = readUint32(trun, 4);
rawDuration += sampleDuration * sampleCount;
rawDuration = sampleDuration * sampleCount;
Copy link
Collaborator

@robwalch robwalch Apr 14, 2020

Choose a reason for hiding this comment

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

@adrian-branescu - So the we only want the traf duration (or moof duration if traf does not have these flags set?). They are redundant?

@robwalch
Copy link
Collaborator

@adrian-branescu thanks for the contribution. Great fix. I've seen a lot of issues with this new duration parsing. I was even considering throwing out the duration parsed here if it's not within a second of the manifest duration (since I've seen it wildly off, but maybe this is why!)

@robwalch robwalch merged commit 7e90e1f into video-dev:feature/v1.0.0 Apr 17, 2020
@robwalch robwalch mentioned this pull request Apr 17, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants