From e3f396479a8a1344c02ac57a532e6588e271aabd Mon Sep 17 00:00:00 2001 From: shubhrai23 Date: Thu, 13 Aug 2026 02:53:03 +0530 Subject: [PATCH 1/2] fix: correctly initialize frame type for tx3g and mov_text subtitles --- src/lib_ccx/mp4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_ccx/mp4.c b/src/lib_ccx/mp4.c index 93d10e340..b25ca708c 100644 --- a/src/lib_ccx/mp4.c +++ b/src/lib_ccx/mp4.c @@ -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) dec_ctx->timing->current_picture_coding_type = CCX_FRAME_TYPE_I_FRAME; set_fts(dec_ctx->timing); From 6e1e22a3b84da8190629648690a49e7d9974d9ca Mon Sep 17 00:00:00 2001 From: shubhrai23 Date: Fri, 14 Aug 2026 05:37:54 +0530 Subject: [PATCH 2/2] fix: update comment and condition order for subtitle tracks --- src/lib_ccx/mp4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_ccx/mp4.c b/src/lib_ccx/mp4.c index b25ca708c..312908083 100644 --- a/src/lib_ccx/mp4.c +++ b/src/lib_ccx/mp4.c @@ -1121,11 +1121,11 @@ int processmp4(struct lib_ccx_ctx *ctx, struct ccx_s_mp4Cfg *cfg, char *file) const LLONG timestamp = (LLONG)((sample->DTS + sample->CTS_Offset) * 1000) / timescale; #endif set_current_pts(dec_ctx->timing, (sample->DTS + sample->CTS_Offset) * MPEG_CLOCK_FREQ / timescale); - // For caption-only tracks (c608/c708), set frame type to I-frame + // For subtitle and caption-only tracks, set frame type to I-frame // 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 || type == GF_ISOM_MEDIA_TEXT || type == GF_ISOM_MEDIA_SUBT) + if (type == GF_ISOM_MEDIA_TEXT || type == GF_ISOM_MEDIA_SUBT || type == GF_ISOM_MEDIA_CLOSED_CAPTION) dec_ctx->timing->current_picture_coding_type = CCX_FRAME_TYPE_I_FRAME; set_fts(dec_ctx->timing);