diff --git a/src/ccextractor.c b/src/ccextractor.c index da9d5c36..71378849 100644 --- a/src/ccextractor.c +++ b/src/ccextractor.c @@ -186,6 +186,11 @@ int start_ccx() ccx_options.use_gop_as_pts = 0; if (ccx_options.ignore_pts_jumps) ccx_common_timing_settings.disable_sync_check = 1; + // When using GOP timing (--goptime), disable sync check because + // GOP time (wall-clock) and PES PTS (stream-relative) are in + // different time bases and will always appear as huge jumps. + if (ccx_options.use_gop_as_pts == 1) + ccx_common_timing_settings.disable_sync_check = 1; mprint("\rAnalyzing data in general mode\n"); tmp = general_loop(ctx); if (!ret) diff --git a/src/lib_ccx/general_loop.c b/src/lib_ccx/general_loop.c index 65cb77f2..807d1a5c 100644 --- a/src/lib_ccx/general_loop.c +++ b/src/lib_ccx/general_loop.c @@ -1018,8 +1018,15 @@ int process_non_multiprogram_general_loop(struct lib_ccx_ctx *ctx, pts = data_node_video->pts; } - set_current_pts(dec_ctx_video->timing, pts); - set_fts(dec_ctx_video->timing); + // When using GOP timing (--goptime), timing is set from GOP headers + // in gop_header(), not from PES PTS. Skip PTS-based timing here + // to avoid conflicts between GOP time (absolute time-of-day) and + // PTS (relative stream time) that cause sync detection failures. + if (ccx_options.use_gop_as_pts != 1) + { + set_current_pts(dec_ctx_video->timing, pts); + set_fts(dec_ctx_video->timing); + } } size_t got = process_m2v(*enc_ctx, dec_ctx_video, data_node_video->buffer, data_node_video->len, dec_sub_video); if (got > 0)