diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 38a9eba63..ee6fc831e 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -630,7 +630,6 @@ INLINE void ng_sdp_attr_manipulations(struct sdp_ng_flags *flags, bencode_item_t switch (__csh_lookup(&command_type)) { - /* CMD_ADD / CMD_SUBST commands */ case CSH_LOOKUP("substitute"): ht = &sm->subst_commands; diff --git a/daemon/sdp.c b/daemon/sdp.c index 0398eb3f4..0ea5d4940 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -302,7 +302,6 @@ static int sdp_manipulate_check(enum command_type command_type, if (!sdp_manipulations) return 0; - GQueue * q_ptr = NULL; GHashTable * ht = NULL; switch (command_type) { @@ -317,12 +316,6 @@ static int sdp_manipulate_check(enum command_type command_type, return 1; break; - case CMD_ADD: - q_ptr = &sdp_manipulations->add_commands; - if (q_ptr->head) - return 1; - break; - case CMD_REM:; if (!attr_name || !attr_name->len) break; @@ -346,6 +339,9 @@ static int sdp_manipulate_check(enum command_type command_type, static void sdp_manipulations_add(struct sdp_chopper *chop, struct sdp_manipulations * sdp_manipulations) { + if (!sdp_manipulations) + return; + GQueue * q_ptr = &sdp_manipulations->add_commands; for (GList *l = q_ptr->head; l; l = l->next) @@ -3170,8 +3166,7 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu /* ADD arbitrary SDP manipulations for a session sessions */ struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, MT_UNKNOWN); - if (sdp_manipulate_check(CMD_ADD, sdp_manipulations, NULL)) - sdp_manipulations_add(chop, sdp_manipulations); + sdp_manipulations_add(chop, sdp_manipulations); for (k = session->media_streams.head; k; k = k->next) { sdp_media = k->data; @@ -3246,8 +3241,7 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu /* ADD arbitrary SDP manipulations for audio/video media sessions */ sdp_manipulations = sdp_manipulations_get_by_id(flags, sdp_media->media_type_id); - if (sdp_manipulate_check(CMD_ADD, sdp_manipulations, NULL)) - sdp_manipulations_add(chop, sdp_manipulations); + sdp_manipulations_add(chop, sdp_manipulations); media_index++; } diff --git a/include/sdp.h b/include/sdp.h index 49073200b..90ee3cbc6 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -8,8 +8,7 @@ #include "media_socket.h" enum command_type { - CMD_ADD = 0, - CMD_REM, + CMD_REM = 1, CMD_SUBST, };