Fix nalu parsing for 3-byte & 4-byte start seqs#301
Merged
Sean-Der merged 1 commit intopion:masterfrom Mar 11, 2025
rileym-arcules:rileym/nalu-parsing-fix
Merged
Fix nalu parsing for 3-byte & 4-byte start seqs#301Sean-Der merged 1 commit intopion:masterfrom rileym-arcules:rileym/nalu-parsing-fix
Sean-Der merged 1 commit intopion:masterfrom
rileym-arcules:rileym/nalu-parsing-fix
Conversation
rileym-arcules
commented
Mar 10, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #301 +/- ##
==========================================
+ Coverage 86.69% 86.76% +0.07%
==========================================
Files 26 26
Lines 3043 3061 +18
==========================================
+ Hits 2638 2656 +18
Misses 348 348
Partials 57 57
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Description
There is an issue in the current
emitNalufunction where the implementation can skip over 3-byte start sequences.The
emitNalufunction was changed in commit bfe92b9 which introduced this regression: bfe92b9#diff-5eca440e933baa4c5491dcd9ccc7c1f4d807994e6c5b54c304228c34fcc3c963L40From analysis of the current
emitNalufunction,rtp/codecs/h264_packet.go
Lines 45 to 67 in ee5524b
one can observe that NALUs with 3-byte start sequences may be skipped over if it is the first NALU, or if it is between two NALUs with 4-byte start sequences (in this case: at L52
end != -1)This PR aims to resolve this issue by searching for 3-byte start sequences and accounting for 4-byte sequences afterward.