Skip to content

fix: correctly initialize frame type for tx3g and mov_text subtitles - #2321

Open
shubhrai23 wants to merge 2 commits into
CCExtractor:masterfrom
shubhrai23:fix/issue-2105-tx3g-timestamps
Open

fix: correctly initialize frame type for tx3g and mov_text subtitles#2321
shubhrai23 wants to merge 2 commits into
CCExtractor:masterfrom
shubhrai23:fix/issue-2105-tx3g-timestamps

Conversation

@shubhrai23

@shubhrai23 shubhrai23 commented Aug 12, 2026

Copy link
Copy Markdown

This PR fixes MP4 subtitle timestamp initialization by ensuring subtitle-only tracks (including \mov_text/\ x3g) get an I-frame picture type so \set_fts()\ can set \min_pts\ from the first sample.

Copilot AI lite review requested due to automatic review settings August 12, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes MP4 subtitle timestamp initialization by ensuring subtitle-only tracks (including mov_text/tx3g) get an I-frame picture type so set_fts() can set min_pts from the first sample.

Changes:

  • Expand the media-type check so GF_ISOM_MEDIA_TEXT and GF_ISOM_MEDIA_SUBT tracks also force current_picture_coding_type = CCX_FRAME_TYPE_I_FRAME before calling set_fts().
  • Align MP4 subtitle handling with how tx3g tracks are already dispatched later in the same loop.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib_ccx/mp4.c Outdated
Comment on lines +1124 to +1128
@@ -1125,7 +1125,7 @@ int processmp4(struct lib_ccx_ctx *ctx, struct ccx_s_mp4Cfg *cfg, char *file)
// so that set_fts() will set min_pts from the first sample.
// Without video frames, frame type would stay Unknown and
// min_pts would never be set, causing broken timestamps.
if (type == GF_ISOM_MEDIA_CLOSED_CAPTION)
if (type == GF_ISOM_MEDIA_CLOSED_CAPTION || type == GF_ISOM_MEDIA_TEXT || type == GF_ISOM_MEDIA_SUBT)
Comment thread src/lib_ccx/mp4.c Outdated
// Without video frames, frame type would stay Unknown and
// min_pts would never be set, causing broken timestamps.
if (type == GF_ISOM_MEDIA_CLOSED_CAPTION)
if (type == GF_ISOM_MEDIA_CLOSED_CAPTION || type == GF_ISOM_MEDIA_TEXT || type == GF_ISOM_MEDIA_SUBT)
@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 128175e...:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 1/7
DVD 3/3
DVR-MS 2/2
General 22/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 69/86
Teletext 0/21
WTV 12/13
XDS 31/34

Your PR breaks these cases:

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --autoprogram --out=srt --latin1 f1422b8bfe..., Last passed: Never

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Check the result page for more info.

@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 128175e...:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 1/7
DVD 3/3
DVR-MS 2/2
General 22/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 69/86
Teletext 0/21
WTV 12/13
XDS 31/34

Your PR breaks these cases:

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --autoprogram --out=srt --latin1 f1422b8bfe..., Last passed: Never

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Check the result page for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants