Repository navigation
Conversation
jantekb
force-pushed
the
bugfix/packet-removal
branch
from
July 21, 2026 09:43
3394880 to
6589d76
Compare
jantekb
marked this pull request as ready for review
July 21, 2026 11:19
|
This branch has not been deployed
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.
What changed
bufferQueuebefore writing it.pollFirst()so removal and retrieval happen as one queue operation.Why
bufferQueueis aConcurrentSkipListSetordered by packet DTS. The previous code calledwritePacket()before removing the packet, butwritePacket()mutates its DTS and PTS. Mutating the ordering key while the packet was still in the set could makeremove()fail.The stale packet was then unreferenced while remaining in the queue and processed repeatedly with
AV_NOPTS_VALUE. This produced millions of repeated DTS messages, blocked stream cleanup, left the temporary MP4 file visible to the test, and generated a 1.6 GiB JUnit report that the report publisher could not parse as a Node.js string.Impact
Buffered packets are now removed before their timestamps are changed, preventing stale packets from becoming stuck in the queue and allowing stream finalization to complete normally.
Validation
mvn -q -Dtest=io.antmedia.test.StreamFetcherUnitTest#testStreamFetcherBuffer testgit diff --checkAV_NOPTS_VALUEDTS messages.