mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
[PR #1858] [MERGED] fix(ts): Skip broken PES packets instead of terminating file processing #2625
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/1858
Author: @cfsmp3
Created: 12/20/2025
Status: ✅ Merged
Merged: 12/20/2025
Merged by: @cfsmp3
Base:
master← Head:fix/issue-1455-uk-freeview-dvb📝 Commits (6)
0fbbc06fix(hevc): Add HEVC/H.265 caption extraction support440cd55fix(hevc): Fix garbled captions by implementing B-frame reordering87bc1d9style: Fix clang-format issue in ts_functions.c9e970fdstyle: Run cargo fmt on avc/core.rs1bdd9abfix(clippy): Suppress dead_code warnings for unused HEVC NAL constants3e9ed30fix(ts): Skip broken PES packets instead of terminating file processing📊 Changes
10 files changed (+376 additions, -119 deletions)
View changed files
📝
src/lib_ccx/avc_functions.c(+80 -33)📝
src/lib_ccx/avc_functions.h(+1 -0)📝
src/lib_ccx/ccx_common_constants.h(+2 -1)📝
src/lib_ccx/general_loop.c(+7 -0)📝
src/lib_ccx/ts_functions.c(+29 -9)📝
src/lib_ccx/ts_info.c(+3 -1)📝
src/rust/src/avc/common_types.rs(+2 -0)📝
src/rust/src/avc/core.rs(+250 -75)📝
src/rust/src/common.rs(+1 -0)📝
src/rust/src/ctorust.rs(+1 -0)📄 Description
Summary
Problem
UK Freeview DVB recordings from September 2022 onwards would fail at 0% with:
VLC and other players could display the subtitles correctly, but ccextractor would terminate immediately.
Root Cause
When
read_video_pes_header()encounters a malformed or truncated PES packet, it returns -1. The calling functioncopy_capbuf_demux_data()then returnedCCX_EOF(-101), which terminated the entire file. This was overly aggressive - a single broken PES packet should be skipped, not terminate the file.Fix
Changed error handling to skip broken packets and continue:
Test Results
Sample subtitle extracted: "of eight 400 ounce gold bars that were stolen in 1998."
All 299 Rust tests pass.
Test plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.