From 11902f63e01f1cba937a0a0a16349ae102c131ac Mon Sep 17 00:00:00 2001 From: sauwming Date: Fri, 3 Nov 2023 12:21:12 +0800 Subject: [PATCH] Update sdp.c --- pjmedia/src/pjmedia/sdp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pjmedia/src/pjmedia/sdp.c b/pjmedia/src/pjmedia/sdp.c index d129dde8ad..83661732a5 100644 --- a/pjmedia/src/pjmedia/sdp.c +++ b/pjmedia/src/pjmedia/sdp.c @@ -597,8 +597,8 @@ PJ_DEF(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool, PJ_ASSERT_RETURN(pool && rtpmap && p_attr, PJ_EINVAL); /* Check that mandatory attributes are specified. */ - PJ_ASSERT_RETURN(rtpmap->enc_name.slen && rtpmap->clock_rate, - PJMEDIA_SDP_EINRTPMAP); + PJ_ASSERT_RETURN(rtpmap->pt.slen && rtpmap->enc_name.slen && + rtpmap->clock_rate, PJMEDIA_SDP_EINRTPMAP); attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr); @@ -611,13 +611,13 @@ PJ_DEF(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool, len = pj_ansi_snprintf(tempbuf, sizeof(tempbuf), "%.*s %.*s/%u%s%.*s", (int)rtpmap->pt.slen, - rtpmap->pt.ptr ? rtpmap->pt.ptr : "(null)", + rtpmap->pt.ptr, (int)rtpmap->enc_name.slen, - rtpmap->enc_name.ptr ? rtpmap->enc_name.ptr : "(null)", + rtpmap->enc_name.ptr, rtpmap->clock_rate, (rtpmap->param.slen ? "/" : ""), (int)rtpmap->param.slen, - rtpmap->param.ptr ? rtpmap->param.ptr : "(null)"); + rtpmap->param.slen ? rtpmap->param.ptr : ""); if (len < 1 || len >= (int)sizeof(tempbuf)) return PJMEDIA_SDP_ERTPMAPTOOLONG;