|
1 | 1 | /* |
2 | 2 | * 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. |
4 | 4 | * |
5 | 5 | * Authors: Christophe Massiot |
6 | 6 | * |
@@ -3040,7 +3040,7 @@ static void upipe_ts_mux_increment(struct upipe *upipe) |
3040 | 3040 | mux->cr_sys_remainder = q.rem; |
3041 | 3041 |
|
3042 | 3042 | /* 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); |
3044 | 3044 | } |
3045 | 3045 |
|
3046 | 3046 | /** @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, |
3176 | 3176 | ubuf_free(ubuf); |
3177 | 3177 | return; |
3178 | 3178 | } |
3179 | | - uref_clock_set_cr_sys(mux->uref, mux->cr_sys - mux->latency); |
| 3179 | + uref_clock_set_cr_sys(mux->uref, mux->cr_sys); |
3180 | 3180 | 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); |
3183 | 3182 | uref_attach_ubuf(mux->uref, ubuf); |
3184 | 3183 | } else { |
3185 | 3184 | uint64_t current_dts_sys; |
3186 | 3185 | if (dts_sys != UINT64_MAX && |
3187 | 3186 | (!ubase_check(uref_clock_get_dts_sys(mux->uref, |
3188 | 3187 | ¤t_dts_sys)) || |
3189 | 3188 | 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); |
3192 | 3190 | uref_block_append(mux->uref, ubuf); |
3193 | 3191 | } |
3194 | 3192 | mux->uref_size += TS_SIZE; |
@@ -3222,7 +3220,7 @@ static void _upipe_ts_mux_watcher(struct upipe *upipe) |
3222 | 3220 | while (nb_packets < NB_PACKETS) { |
3223 | 3221 | upipe_ts_mux_increment(upipe); |
3224 | 3222 | 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); |
3226 | 3224 |
|
3227 | 3225 | while (mux->uref_size < mux->mtu) { |
3228 | 3226 | nb_packets++; |
@@ -3346,7 +3344,7 @@ static void upipe_ts_mux_work_file(struct upipe *upipe, struct upump **upump_p) |
3346 | 3344 | #endif |
3347 | 3345 | if (mux->cr_sys == UINT64_MAX) { |
3348 | 3346 | 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; |
3350 | 3348 | if (mux->initial_cr_prog != UINT64_MAX) { |
3351 | 3349 | upipe_ts_mux_init_cr_prog(upipe, mux->initial_cr_prog); |
3352 | 3350 | mux->initial_cr_prog = UINT64_MAX; |
@@ -3708,7 +3706,7 @@ static void upipe_ts_mux_build_flow_def(struct upipe *upipe) |
3708 | 3706 | } |
3709 | 3707 |
|
3710 | 3708 | if (unlikely(!ubase_check(uref_clock_set_latency(flow_def, |
3711 | | - mux->latency + mux->mux_delay)) || |
| 3709 | + mux->mux_delay)) || |
3712 | 3710 | !ubase_check(uref_block_flow_set_octetrate(flow_def, |
3713 | 3711 | mux->total_octetrate)) || |
3714 | 3712 | !ubase_check(uref_block_flow_set_size(flow_def, |
|
0 commit comments