Fix PTS rollover detection using per-stream state instead of shared s…#2131
Open
Aman-Cool wants to merge 1 commit intoCCExtractor:masterfrom
Open
Fix PTS rollover detection using per-stream state instead of shared s…#2131Aman-Cool wants to merge 1 commit intoCCExtractor:masterfrom
Aman-Cool wants to merge 1 commit intoCCExtractor:masterfrom
Conversation
Author
|
Hey @cfsmp3 ,This fixes a silent bug where batch-processing multiple TS files could shift all subtitle timestamps in file 2 by ~26.5 hours due to a Verified the bug in the actual source, confirmed it compiles clean, and updated the changelog before opening this. Happy to make changes if anything needs adjusting! |
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 6f7ce27...:
Your PR breaks these cases:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
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.
[FIX] Fix PTS rollover detection using per-stream state instead of shared static
In raising this pull request, I confirm the following:
My familiarity with the project is as follows (check one):
read_video_pes_header()used astaticlocal variable (current_pts_33) to track the previous PTS for rollover detection. Since it's static, it was shared across all PIDs and across all input files in a batch run.When file 1 ends with a high PTS (top bits = 7) and file 2 starts fresh with a low PTS, the rollover detector incorrectly treats this as a legitimate wrap and increments
rollover_bits. Every subtitle in file 2 then gets its timestamp shifted forward by ~26.5 hours. CCExtractor exits 0, the output file looks valid, but all timestamps are completely wrong.Fixed by moving
current_pts_33intodemuxer_dataasprev_pts_33so each stream independently tracks its own previous PTS. 3 files, 5 lines changed. No logic changes.