summaryrefslogtreecommitdiff
path: root/res/res_pjsip_sdp_rtp.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-10-19 00:56:11 +0000
committerMatthew Jordan <mjordan@digium.com>2014-10-19 00:56:11 +0000
commit2c7556769cfe2652c82087279588466fb17a4590 (patch)
tree2dcd45d047ed5c51dfb7c480925e0afb946f2bb7 /res/res_pjsip_sdp_rtp.c
parent7a76de11b17c51219b2246f005a2604b367140d6 (diff)
res/res_pjsip_sdp_rtp: Remove left over reference to override_prefs
The usage of the local override_prefs variable in create_outgoing_sdp_stream was previously to track an override format preference set by PJSIP_MEDIA_OFFER. Now, however, that function simply sets the joint capabilities structure, session->req_caps. During the media format rework, the override_prefs was instead used to check if there were any formats in session->req_caps. However, this usage isn't useful in create_outgoing_sdp_stream. session->req_caps contains the negotiated formats for *all* streams, not just the current one being created. Thus, so long as any stream of any type has provided a format, override_prefs will be non-zero. Hence, its usage in checking whether or not we should look at the formats on the endpoint or the joint capabilities is generally useless. There's only two things useful to check: (1) Does the endpoint have a format for the media type? (2) Did we negotiate a format for the media type? If either of those is a 'no', then we must kill the media stream. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@425923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r--res/res_pjsip_sdp_rtp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 1f863008f..092157cbc 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -899,13 +899,11 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
int rtp_code;
RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup);
enum ast_media_type media_type = stream_to_media_type(session_media->stream_type);
- int use_override_prefs = ast_format_cap_count(session->req_caps);
-
int direct_media_enabled = !ast_sockaddr_isnull(&session_media->direct_media_addr) &&
ast_format_cap_count(session->direct_media_cap);
- if ((use_override_prefs && !ast_format_cap_has_type(session->req_caps, media_type)) ||
- (!use_override_prefs && !ast_format_cap_has_type(session->endpoint->media.codecs, media_type))) {
+ if (!ast_format_cap_has_type(session->endpoint->media.codecs, media_type) ||
+ !ast_format_cap_has_type(session->req_caps, media_type)) {
/* If no type formats are configured don't add a stream */
return 0;
} else if (!session_media->rtp && create_rtp(session, session_media, session->endpoint->media.rtp.ipv6)) {