diff options
-rw-r--r-- | channels/chan_sip.c | 6 | ||||
-rw-r--r-- | include/asterisk/rtp_engine.h | 3 | ||||
-rw-r--r-- | main/rtp_engine.c | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b1f32c06b..da7a12b4a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -9092,8 +9092,8 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ } else if (sscanf(a, "rtpmap: %30u %127[^/]/%30u", &codec, mimeSubtype, &sample_rate) == 3) { /* We have a rtpmap to handle */ if (*last_rtpmap_codec < SDP_MAX_RTPMAP_CODECS) { - if (ast_rtp_codecs_payloads_set_rtpmap_type_rate(newaudiortp, NULL, codec, "audio", mimeSubtype, - ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0, sample_rate) != -1) { + if (!(ast_rtp_codecs_payloads_set_rtpmap_type_rate(newaudiortp, NULL, codec, "audio", mimeSubtype, + ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0, sample_rate))) { if (debug) ast_verbose("Found audio description format %s for ID %d\n", mimeSubtype, codec); //found_rtpmap_codecs[last_rtpmap_codec] = codec; @@ -9179,7 +9179,7 @@ static int process_sdp_a_video(const char *a, struct sip_pvt *p, struct ast_rtp_ if (*last_rtpmap_codec < SDP_MAX_RTPMAP_CODECS) { /* Note: should really look at the '#chans' params too */ if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) { - if (ast_rtp_codecs_payloads_set_rtpmap_type_rate(newvideortp, NULL, codec, "video", mimeSubtype, 0, sample_rate) != -1) { + if (!(ast_rtp_codecs_payloads_set_rtpmap_type_rate(newvideortp, NULL, codec, "video", mimeSubtype, 0, sample_rate))) { if (debug) ast_verbose("Found video description format %s for ID %d\n", mimeSubtype, codec); //found_rtpmap_codecs[last_rtpmap_codec] = codec; diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h index 4c5753e84..f8bf74931 100644 --- a/include/asterisk/rtp_engine.h +++ b/include/asterisk/rtp_engine.h @@ -968,7 +968,8 @@ void ast_rtp_codecs_payloads_set_m_type(struct ast_rtp_codecs *codecs, struct as * \param options Optional options that may change the behavior of this specific payload * * \retval 0 success - * \retval -1 failure + * \retval -1 failure, invalid payload numbe + * \retval -2 failure, unknown mimetype * * Example usage: * diff --git a/main/rtp_engine.c b/main/rtp_engine.c index b79ef0bbb..62a515b24 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -501,8 +501,8 @@ int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs, } /* if both sample rates have been supplied, and they don't match, - then this not a match; if one has not been supplied, then the - rates are not compared */ + * then this not a match; if one has not been supplied, then the + * rates are not compared */ if (sample_rate && t->sample_rate && (sample_rate != t->sample_rate)) { continue; |