From 9e992c24357dc19e6b0044584c553e802e0aebd1 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 29 Jun 2017 18:04:18 +0200 Subject: [PATCH] osmo_ortp.c: Duration of a RTP frame affects timestamp of the next one Duration of an RTP frames dictates the timestamp used for the next frame, not for the one being sent now. It was done like this before to account for possible losses. Implementation wise, the duration was understood as "duration between last frame was sent and now when current one is sent". It makes more sense to use it as the duration in number of sampling ticks as described on the function documentation, specially now that we can account for extra time by means of osmo_rtp_skipped_frame. Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548 --- src/trau/osmo_ortp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index c9480ff..c49a23d 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -496,9 +496,9 @@ int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, return -ENOMEM; rtp_set_markbit(mblk, marker); - rs->tx_timestamp += duration; rc = rtp_session_sendm_with_ts(rs->sess, mblk, rs->tx_timestamp); + rs->tx_timestamp += duration; if (rc < 0) { /* no need to free() the mblk, as rtp_session_rtp_send() * unconditionally free()s the mblk even in case of