Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib_ccx/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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);

Expand Down
Loading