Fix audio-video sync issue in DASH MP4 muxer#13369
Fix audio-video sync issue in DASH MP4 muxer#13369Gautam-aman wants to merge 4 commits intoTeamNewPipe:devfrom
Conversation
|
Please do not remove the default PR template. Restore it and fill it in properly |
|
Thanks! I’ve restored the PR template and filled it properly. |
|
Could you please give a detailed explanation of how your solution works and how it fixes the problem, as well as provide clear instructions of how to test that the solution fixes the problem? Either the code must be self-explanatory, or it must be explained elsewhere in documentation such as in this PR description: but right now there is neither. I don't know what PTS is or how this works, and it would be best for everyone to remove all assumed knowledge and have things be clear as possible and easily understood. |
| final boolean allSet; | ||
| { | ||
| boolean temp = true; | ||
| for (int k = 0; k < readers.length; k++) { | ||
| if (!firstPtsSet[k]) { | ||
| temp = false; | ||
| break; | ||
| } | ||
| } | ||
| allSet = temp; | ||
| } |
There was a problem hiding this comment.
I don't understand your code here. Why do you introduce a temp var? Can't you set allSet = false directly? This should be equal to you code but is easier to understand:
| final boolean allSet; | |
| { | |
| boolean temp = true; | |
| for (int k = 0; k < readers.length; k++) { | |
| if (!firstPtsSet[k]) { | |
| temp = false; | |
| break; | |
| } | |
| } | |
| allSet = temp; | |
| } | |
| boolean allSet = true; | |
| for (int k = 0; allSet && k < readers.length; k++) { | |
| if (!firstPtsSet[k]) { | |
| allSet = false; | |
| } | |
| } |
| final boolean[] minPtsComputedArr = new boolean[]{false}; | ||
| final long[] minPtsArr = new long[]{0}; |
There was a problem hiding this comment.
Why are these two vars arrays? They both only hold one value.
What is it?
Description of the changes in your PR
Fix audio-video synchronization issue in DASH MP4 muxing.
Audio and video tracks extracted from DASH streams may have different starting
composition timestamps (PTS), which previously caused desynchronization.
This PR normalizes timestamps by:
basePts)This ensures both tracks share a consistent timeline during muxing.
APK testing
Tested using locally built APK.
Due diligence
Issue
Fixes #12640