summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-06-22 07:33:46 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-06-22 07:33:46 +0000
commit33a37dfd522fe546fde98934d1223f4b7995f1e8 (patch)
tree84e95d01cbfa820760fc19768a21df834417ac7b /pjmedia
parenta5fd50f33a261b9e3159e2c2708aa3402db78fc7 (diff)
Fixed #1860: Modify pjmedia_sdp_neg_fmt_match() to check for encoding parameters as well
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5114 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/include/pjmedia/sdp_neg.h9
-rw-r--r--pjmedia/src/pjmedia/sdp_neg.c7
2 files changed, 11 insertions, 5 deletions
diff --git a/pjmedia/include/pjmedia/sdp_neg.h b/pjmedia/include/pjmedia/sdp_neg.h
index a17c74ce..d5ed9d27 100644
--- a/pjmedia/include/pjmedia/sdp_neg.h
+++ b/pjmedia/include/pjmedia/sdp_neg.h
@@ -788,10 +788,11 @@ PJ_DECL(pj_status_t) pjmedia_sdp_neg_register_fmt_match_cb(
/**
* Match format in the SDP media offer and answer. The matching mechanism
- * will be done by comparing the encoding name and clock rate, and if the
- * custom format matching callback for the specified format is registered,
- * see #pjmedia_sdp_neg_register_fmt_match_cb(), it will be called for more
- * detail verification, e.g: format parameters specified in SDP fmtp.
+ * will be done by comparing the encoding name, clock rate, and encoding
+ * parameters (if any), and if the custom format matching callback
+ * for the specified format is registered, see
+ * #pjmedia_sdp_neg_register_fmt_match_cb(), it will be called for
+ * more detail verification, e.g: format parameters specified in SDP fmtp.
*
* @param pool The memory pool.
* @param offer The SDP media offer.
diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c
index 438b3aec..784718c8 100644
--- a/pjmedia/src/pjmedia/sdp_neg.c
+++ b/pjmedia/src/pjmedia/sdp_neg.c
@@ -1599,7 +1599,12 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_fmt_match(pj_pool_t *pool,
pjmedia_sdp_attr_get_rtpmap(attr, &a_rtpmap);
if (pj_stricmp(&o_rtpmap.enc_name, &a_rtpmap.enc_name) != 0 ||
- o_rtpmap.clock_rate != a_rtpmap.clock_rate)
+ (o_rtpmap.clock_rate != a_rtpmap.clock_rate) ||
+ (!(pj_stricmp(&o_rtpmap.param, &a_rtpmap.param) == 0 ||
+ (a_rtpmap.param.slen == 0 && o_rtpmap.param.slen == 1 &&
+ *o_rtpmap.param.ptr == '1') ||
+ (o_rtpmap.param.slen == 0 && a_rtpmap.param.slen == 1 &&
+ *a_rtpmap.param.ptr=='1'))))
{
return PJMEDIA_SDP_EFORMATNOTEQUAL;
}