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.
This commit is contained in:
Arun Raghavan 2024-09-09 14:04:04 -04:00
parent 5c2b5fa552
commit d79b995e51

View file

@ -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");
}