Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtp/sess: fix missing srate_tx locking #1231

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rtp/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,12 @@ static int encode_handler(struct mbuf *mb, void *arg)
static int mk_sr(struct rtcp_sess *sess, struct mbuf *mb)
{
struct txstat txstat;
uint32_t srate_tx;
int err;

mtx_lock(sess->lock);
txstat = sess->txstat;
srate_tx = sess->srate_tx;
sess->txstat.ts_synced = false;
mtx_unlock(sess->lock);

Expand All @@ -442,7 +444,7 @@ static int mk_sr(struct rtcp_sess *sess, struct mbuf *mb)

dur = jfs_rt - txstat.jfs_rt_ref;
rtp_ts = (uint32_t)((uint64_t)txstat.ts_ref + dur *
sess->srate_tx / 1000000u);
srate_tx / 1000000u);

err = rtcp_encode(mb, RTCP_SR, sess->senderc,
rtp_sess_ssrc(sess->rs), ntp.hi, ntp.lo,
Expand Down
Loading