Skip to content
Merged
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
19 changes: 19 additions & 0 deletions src/lib_ccx/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ static int process_xdvb_track(struct lib_ccx_ctx *ctx, const char *basename, GF_

dec_ctx = update_decoder_list(ctx);
enc_ctx = update_encoder_list(ctx);

// Set buffer data type to CCX_PES for MP4/MOV MPEG-2 tracks.
// This ensures cb_field counters are not incremented in do_cb(),
// which is correct because container formats associate captions
// with the frame's PTS directly.
dec_ctx->in_bufferdatatype = CCX_PES;

if ((sample_count = gf_isom_get_sample_count(f, track)) < 1)
{
return 0;
Expand Down Expand Up @@ -249,6 +256,12 @@ static int process_avc_track(struct lib_ccx_ctx *ctx, const char *basename, GF_I

dec_ctx = update_decoder_list(ctx);

// Set buffer data type to CCX_H264 for MP4/MOV AVC tracks.
// This ensures cb_field counters are not incremented in do_cb(),
// which is correct because container formats associate captions
// with the frame's PTS directly.
dec_ctx->in_bufferdatatype = CCX_H264;

if ((sample_count = gf_isom_get_sample_count(f, track)) < 1)
{
return 0;
Expand Down Expand Up @@ -326,6 +339,12 @@ static int process_hevc_track(struct lib_ccx_ctx *ctx, const char *basename, GF_
// Enable HEVC mode
dec_ctx->avc_ctx->is_hevc = 1;

// Set buffer data type to CCX_H264 for MP4/MOV HEVC tracks.
// This ensures cb_field counters are not incremented in do_cb(),
// which is correct because container formats associate captions
// with the frame's PTS directly.
dec_ctx->in_bufferdatatype = CCX_H264;

if ((sample_count = gf_isom_get_sample_count(f, track)) < 1)
{
return 0;
Expand Down
Loading