Skip to content

Commit 3e15a14

Browse files
quariumcmassiot
authored andcommitted
upipe_ts_mux: remove mux latency from output
1 parent 5011ad8 commit 3e15a14

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/upipe-ts/upipe_ts_mux.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (C) 2013-2019 OpenHeadend S.A.R.L.
3-
* Copyright (C) 2020-2024 EasyTools S.A.S.
3+
* Copyright (C) 2020-2025 EasyTools S.A.S.
44
*
55
* Authors: Christophe Massiot
66
*
@@ -3040,7 +3040,7 @@ static void upipe_ts_mux_increment(struct upipe *upipe)
30403040
mux->cr_sys_remainder = q.rem;
30413041

30423042
/* Tell PSI tables to prepare packets. */
3043-
upipe_ts_mux_prepare_psi(upipe, mux->cr_sys - mux->latency, mux->latency);
3043+
upipe_ts_mux_prepare_psi(upipe, mux->cr_sys, mux->latency);
30443044
}
30453045

30463046
/** @internal @This shows the next increment of cr_sys.
@@ -3176,19 +3176,17 @@ static void upipe_ts_mux_append(struct upipe *upipe, struct ubuf *ubuf,
31763176
ubuf_free(ubuf);
31773177
return;
31783178
}
3179-
uref_clock_set_cr_sys(mux->uref, mux->cr_sys - mux->latency);
3179+
uref_clock_set_cr_sys(mux->uref, mux->cr_sys);
31803180
if (dts_sys != UINT64_MAX)
3181-
uref_clock_set_cr_dts_delay(mux->uref,
3182-
dts_sys - (mux->cr_sys - mux->latency));
3181+
uref_clock_set_cr_dts_delay(mux->uref, dts_sys - mux->cr_sys);
31833182
uref_attach_ubuf(mux->uref, ubuf);
31843183
} else {
31853184
uint64_t current_dts_sys;
31863185
if (dts_sys != UINT64_MAX &&
31873186
(!ubase_check(uref_clock_get_dts_sys(mux->uref,
31883187
&current_dts_sys)) ||
31893188
current_dts_sys > dts_sys))
3190-
uref_clock_set_cr_dts_delay(mux->uref,
3191-
dts_sys - (mux->cr_sys - mux->latency));
3189+
uref_clock_set_cr_dts_delay(mux->uref, dts_sys - mux->cr_sys);
31923190
uref_block_append(mux->uref, ubuf);
31933191
}
31943192
mux->uref_size += TS_SIZE;
@@ -3222,7 +3220,7 @@ static void _upipe_ts_mux_watcher(struct upipe *upipe)
32223220
while (nb_packets < NB_PACKETS) {
32233221
upipe_ts_mux_increment(upipe);
32243222
if (mux->uref != NULL) /* capped VBR */
3225-
uref_clock_set_cr_sys(mux->uref, mux->cr_sys - mux->latency);
3223+
uref_clock_set_cr_sys(mux->uref, mux->cr_sys);
32263224

32273225
while (mux->uref_size < mux->mtu) {
32283226
nb_packets++;
@@ -3346,7 +3344,7 @@ static void upipe_ts_mux_work_file(struct upipe *upipe, struct upump **upump_p)
33463344
#endif
33473345
if (mux->cr_sys == UINT64_MAX) {
33483346
upipe_verbose_va(upipe, "work file min=%"PRIu64, min_cr_sys);
3349-
mux->cr_sys = min_cr_sys + mux->latency;
3347+
mux->cr_sys = min_cr_sys;
33503348
if (mux->initial_cr_prog != UINT64_MAX) {
33513349
upipe_ts_mux_init_cr_prog(upipe, mux->initial_cr_prog);
33523350
mux->initial_cr_prog = UINT64_MAX;
@@ -3708,7 +3706,7 @@ static void upipe_ts_mux_build_flow_def(struct upipe *upipe)
37083706
}
37093707

37103708
if (unlikely(!ubase_check(uref_clock_set_latency(flow_def,
3711-
mux->latency + mux->mux_delay)) ||
3709+
mux->mux_delay)) ||
37123710
!ubase_check(uref_block_flow_set_octetrate(flow_def,
37133711
mux->total_octetrate)) ||
37143712
!ubase_check(uref_block_flow_set_size(flow_def,

tests/upipe_ts_test.ts

564 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)