mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
[PR #2013] [MERGED] docs: Clarify PS probe limit calculation (explain magic number) #2814
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/2013
Author: @cfsmp3
Created: 1/10/2026
Status: ✅ Merged
Merged: 1/11/2026
Merged by: @cfsmp3
Base:
master← Head:docs/explain-ps-probe-limit-magic-number📝 Commits (1)
d5201b1docs: Clarify PS probe limit calculation with inline comment📊 Changes
1 file changed (+6 additions, -2 deletions)
View changed files
📝
src/rust/src/demuxer/stream_functions.rs(+6 -2)📄 Description
Summary
Replaces the magic number
49997with50000 - 3and adds a clear inline comment explaining the PS stream probe limit calculation.Changes
Why This Matters
The number 49997 appears arbitrary without context. The new code makes it clear that:
Why subtract 3: The loop checks
startbytes[i], [i+1], [i+2], [i+3], so we must stop 3 bytes before the end to avoid out-of-bounds accessWhy 50000: We cap the scan range for large buffers (no need to scan megabytes when 50KB is sufficient to detect the format)
Why saturating_sub: Handles edge case of tiny buffers (< 3 bytes) without underflow
Testing
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.