From 0e631832ab7afbf49c9b8d508c18366aaceeb407 Mon Sep 17 00:00:00 2001 From: Heikki Tampio Date: Wed, 27 Mar 2024 11:40:17 +0200 Subject: [PATCH] rtp: Fix bug when using custom RTP timestamps with multiple large NALs in an h26x access unit --- src/rtp.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rtp.cc b/src/rtp.cc index 3ceeefe..4076301 100644 --- a/src/rtp.cc +++ b/src/rtp.cc @@ -162,7 +162,12 @@ void uvgrtp::rtp::fill_header(uint8_t *buffer, bool use_old_ts) *(uint32_t *)&buffer[8] = htonl(*ssrc_.get()); if (use_old_ts) { - *(uint32_t*)&buffer[4] = htonl((u_long)rtp_ts_); + if (timestamp_ == INVALID_TS) { + *(uint32_t*)&buffer[4] = htonl((u_long)rtp_ts_); + } + else { + *(uint32_t*)&buffer[4] = htonl((u_long)timestamp_); + } } else if (timestamp_ == INVALID_TS) {