Skip to content

Commit

Permalink
upipe_ts_metadata_generator: fix late input
Browse files Browse the repository at this point in the history
This patch prevent (very) late input from sending multiple late metadata
when starting.
  • Loading branch information
quarium authored and cmassiot committed Jan 11, 2024
1 parent 30e846e commit 92f68f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/upipe-ts/upipe_ts_metadata_generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ static void upipe_ts_mdg_send(struct upipe *upipe)
upipe_ts_mdg->max_octetrate = upipe_ts_mdg->size;
}

unsigned intervals = (now - cr_sys) / upipe_ts_mdg->interval;
cr_sys += intervals * upipe_ts_mdg->interval;
pts_prog += intervals * upipe_ts_mdg->interval;
uref_clock_set_cr_sys(uref, cr_sys);
uref_clock_set_pts_prog(uref, pts_prog);

upipe_ts_mdg_output(upipe, uref_dup(uref), &upipe_ts_mdg->upump);

if (!upipe_ts_mdg->interval)
Expand Down

0 comments on commit 92f68f7

Please sign in to comment.