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.
This PR will...
Fix handling of AVC sample where sample contain PTS that is less than DTS and the PTS does not always increase like the DTS:
Why is this Pull Request needed?
The current workaround will set DTS to an offset of PTS if the largest "PTS < DTS" discrepancy exceeds two average sample durations. This is a problem when PTS is not always increasing, since it results in out-of-order DTS in our samples.
The second method of adjusting all DTS evenly does not work in Safari with such a large offset which is why we have methods of adjusting timestamps. These changes just ensure that we maintain increasing DTS values with PTS that is never less than DTS with minimal impact to CTS (the difference between PTS and DTS).