mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-27 16:40:07 +00:00
[PR #1763] [CLOSED] fix: prevent infinite loop when processing TS files with no subtitles #2486
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/1763
Author: @DhanushVarma-2
Created: 11/10/2025
Status: ❌ Closed
Base:
master← Head:fix-ts-infinite-loop-fresh📝 Commits (2)
8d4d84bfix: prevent infinite loop when TS files have no subtitle streams926293cstyle: apply clang-format to ts_functions.c📊 Changes
1 file changed (+27 additions, -0 deletions)
View changed files
📝
src/lib_ccx/ts_functions.c(+27 -0)📄 Description
Problem
When processing TS files containing no subtitles, ccextractor enters an infinite loop instead of exiting gracefully (Issue #1754).
Root Cause
The
ts_readstreamfunction had ado-while (!gotpes)loop that would run indefinitely when no subtitle streams were detected, becausegotpesnever became true in files without subtitles.Solution
Instead of using an arbitrary packet limit, this fix properly detects when no subtitle streams exist by:
ctx->num_of_PIDs == 0)CCX_EOFwith a clear debug message when no subtitles are foundWhy This Approach is Better
Changes Made
src/lib_ccx/ts_functions.c: Added PMT analysis tracking and caption stream detection ints_readstreamfunctionTesting
Fixes #1754
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.