From d79b995e51f57f3a78a1dcd2c6d77d89d2a252f8 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 9 Sep 2024 14:04:04 -0400 Subject: [PATCH] module-rtp-sap: Make sure we don't publish a null refclk If the PTP refclk is not readable, we fallback to the stored ts_refclk, which might be NULL. Make sure we check for this case. --- src/modules/module-rtp-sap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/module-rtp-sap.c b/src/modules/module-rtp-sap.c index 1efedebc2..defd11094 100644 --- a/src/modules/module-rtp-sap.c +++ b/src/modules/module-rtp-sap.c @@ -758,10 +758,10 @@ static int send_sap(struct impl *impl, struct session *sess, bool bye) impl->gm_id[6], impl->gm_id[7], 0/* domain */); - } else { - spa_strbuf_append(&buf, "a=ts-refclk:%s\n", sdp->ts_refclk); + } else if (sdp->ts_refclk != NULL) { + spa_strbuf_append(&buf, "a=ts-refclk:%s\n", sdp->ts_refclk); } - spa_strbuf_append(&buf, "a=mediaclk:direct=%u\n", sdp->ts_offset); + spa_strbuf_append(&buf, "a=mediaclk:direct=%u\n", sdp->ts_offset); } else { spa_strbuf_append(&buf, "a=mediaclk:sender\n"); }