From 4ab95a049febb41a03839c8fd56beb8f880fc081 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 11 Jul 2023 15:28:40 -0400 Subject: [PATCH] MT#56128 remove unsupported media type warning Media types must be given explicitly anyway, so we don't need to warn when we encounter a different one, as it's entirely expected that we won't operate on it. Change-Id: Ic6b808422ceb5ae857a4d0a99379a1c858bb6fd8 --- daemon/sdp.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index ccf847209..888e1a4b9 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -302,21 +302,11 @@ static int sdp_manipulate_check(enum command_type command_type, if (!sdp_manipulations) return 0; - /* for now we only support session lvl, audio and media streams */ - if (media_type == MT_OTHER) - { - ilog(LOG_WARNING, "SDP manipulations: Unsupported media type '%d', can't manipulate these attributes.", - media_type); - return 0; - } - GQueue * q_ptr = NULL; GHashTable * ht = NULL; switch (command_type) { - case CMD_SUBST:; - ht = NULL; - + case CMD_SUBST: if (!attr_name || !attr_name->len) break; @@ -327,8 +317,11 @@ static int sdp_manipulate_check(enum command_type command_type, case MT_VIDEO: ht = sdp_manipulations->subst_commands_video; break; - default: /* MT_UNKNOWN */ + case MT_UNKNOWN: ht = sdp_manipulations->subst_commands_glob; + break; + default: + break; } str * l = ht ? g_hash_table_lookup(ht, attr_name) : NULL; @@ -336,7 +329,7 @@ static int sdp_manipulate_check(enum command_type command_type, return 1; break; - case CMD_ADD:; + case CMD_ADD: switch (media_type) { case MT_AUDIO: q_ptr = &sdp_manipulations->add_commands_audio; @@ -344,16 +337,17 @@ static int sdp_manipulate_check(enum command_type command_type, case MT_VIDEO: q_ptr = &sdp_manipulations->add_commands_video; break; - default: /* MT_UNKNOWN */ + case MT_UNKNOWN: q_ptr = &sdp_manipulations->add_commands_glob; + break; + default: + break; } if (q_ptr && q_ptr->head) return 1; break; case CMD_REM:; - ht = NULL; - if (!attr_name || !attr_name->len) break; @@ -364,8 +358,11 @@ static int sdp_manipulate_check(enum command_type command_type, case MT_VIDEO: ht = sdp_manipulations->rem_commands_video; break; - default: /* MT_UNKNOWN */ + case MT_UNKNOWN: ht = sdp_manipulations->rem_commands_glob; + break; + default: + break; } if (ht && g_hash_table_lookup(ht, attr_name)) return 1;