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
5 changes: 4 additions & 1 deletion src/lib_ccx/wtv_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,13 @@ LLONG get_data(struct lib_ccx_ctx *ctx, struct wtv_chunked_buffer *cb, struct de
{ // Ignore -1 timestamps
LLONG pes_time = time_to_pes_time(time);
set_current_pts(dec_ctx->timing, pes_time);
// Set min_pts on first valid timestamp to enable fts_now calculation
// Set min_pts and sync_pts on first valid timestamp to enable fts_now calculation
if (dec_ctx->timing->min_pts == 0x01FFFFFFFF || pes_time < dec_ctx->timing->min_pts)
{
dec_ctx->timing->min_pts = pes_time;
// Also set sync_pts to prevent PTS jump detection from triggering
// when pts_set becomes MinPtsSet (sync_pts - current_pts would be huge otherwise)
dec_ctx->timing->sync_pts = pes_time;
}
// pts_set = 2 (MinPtsSet) is required for proper fts_now calculation
dec_ctx->timing->pts_set = 2;
Expand Down
Loading