Skip to content

Commit f376862

Browse files
authored
fix(wtv): Set sync_pts alongside min_pts to prevent PTS jump detection
2 parents a0593c6 + c733902 commit f376862

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib_ccx/wtv_functions.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,13 @@ LLONG get_data(struct lib_ccx_ctx *ctx, struct wtv_chunked_buffer *cb, struct de
438438
{ // Ignore -1 timestamps
439439
LLONG pes_time = time_to_pes_time(time);
440440
set_current_pts(dec_ctx->timing, pes_time);
441-
// Set min_pts on first valid timestamp to enable fts_now calculation
441+
// Set min_pts and sync_pts on first valid timestamp to enable fts_now calculation
442442
if (dec_ctx->timing->min_pts == 0x01FFFFFFFF || pes_time < dec_ctx->timing->min_pts)
443443
{
444444
dec_ctx->timing->min_pts = pes_time;
445+
// Also set sync_pts to prevent PTS jump detection from triggering
446+
// when pts_set becomes MinPtsSet (sync_pts - current_pts would be huge otherwise)
447+
dec_ctx->timing->sync_pts = pes_time;
445448
}
446449
// pts_set = 2 (MinPtsSet) is required for proper fts_now calculation
447450
dec_ctx->timing->pts_set = 2;

0 commit comments

Comments
 (0)