Skip to content

Commit

Permalink
upipe_ts_mux: remove mux latency fron output
Browse files Browse the repository at this point in the history
  • Loading branch information
quarium committed Jan 23, 2025
1 parent bd629d4 commit 2ad85d5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/upipe-ts/upipe_ts_mux.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2013-2019 OpenHeadend S.A.R.L.
* Copyright (C) 2020-2024 EasyTools S.A.S.
* Copyright (C) 2020-2025 EasyTools S.A.S.
*
* Authors: Christophe Massiot
*
Expand Down Expand Up @@ -2992,7 +2992,7 @@ static void upipe_ts_mux_increment(struct upipe *upipe)
mux->cr_sys_remainder = q.rem;

/* Tell PSI tables to prepare packets. */
upipe_ts_mux_prepare_psi(upipe, mux->cr_sys - mux->latency, mux->latency);
upipe_ts_mux_prepare_psi(upipe, mux->cr_sys, 0);
}

/** @internal @This shows the next increment of cr_sys.
Expand Down Expand Up @@ -3128,19 +3128,17 @@ static void upipe_ts_mux_append(struct upipe *upipe, struct ubuf *ubuf,
ubuf_free(ubuf);
return;
}
uref_clock_set_cr_sys(mux->uref, mux->cr_sys - mux->latency);
uref_clock_set_cr_sys(mux->uref, mux->cr_sys);
if (dts_sys != UINT64_MAX)
uref_clock_set_cr_dts_delay(mux->uref,
dts_sys - (mux->cr_sys - mux->latency));
uref_clock_set_cr_dts_delay(mux->uref, dts_sys - mux->cr_sys);
uref_attach_ubuf(mux->uref, ubuf);
} else {
uint64_t current_dts_sys;
if (dts_sys != UINT64_MAX &&
(!ubase_check(uref_clock_get_dts_sys(mux->uref,
&current_dts_sys)) ||
current_dts_sys > dts_sys))
uref_clock_set_cr_dts_delay(mux->uref,
dts_sys - (mux->cr_sys - mux->latency));
uref_clock_set_cr_dts_delay(mux->uref, dts_sys - mux->cr_sys);
uref_block_append(mux->uref, ubuf);
}
mux->uref_size += TS_SIZE;
Expand Down Expand Up @@ -3174,7 +3172,7 @@ static void _upipe_ts_mux_watcher(struct upipe *upipe)
while (nb_packets < NB_PACKETS) {
upipe_ts_mux_increment(upipe);
if (mux->uref != NULL) /* capped VBR */
uref_clock_set_cr_sys(mux->uref, mux->cr_sys - mux->latency);
uref_clock_set_cr_sys(mux->uref, mux->cr_sys);

while (mux->uref_size < mux->mtu) {
nb_packets++;
Expand Down Expand Up @@ -3660,7 +3658,7 @@ static void upipe_ts_mux_build_flow_def(struct upipe *upipe)
}

if (unlikely(!ubase_check(uref_clock_set_latency(flow_def,
mux->latency + mux->mux_delay)) ||
mux->mux_delay)) ||
!ubase_check(uref_block_flow_set_octetrate(flow_def,
mux->total_octetrate)) ||
!ubase_check(uref_block_flow_set_size(flow_def,
Expand Down

0 comments on commit 2ad85d5

Please sign in to comment.