Browse Source

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
pull/1692/head
Richard Fuchs 2 years ago
parent
commit
4ab95a049f
1 changed files with 14 additions and 17 deletions
  1. +14
    -17
      daemon/sdp.c

+ 14
- 17
daemon/sdp.c View File

@ -302,21 +302,11 @@ static int sdp_manipulate_check(enum command_type command_type,
if (!sdp_manipulations) if (!sdp_manipulations)
return 0; 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; GQueue * q_ptr = NULL;
GHashTable * ht = NULL; GHashTable * ht = NULL;
switch (command_type) { switch (command_type) {
case CMD_SUBST:;
ht = NULL;
case CMD_SUBST:
if (!attr_name || !attr_name->len) if (!attr_name || !attr_name->len)
break; break;
@ -327,8 +317,11 @@ static int sdp_manipulate_check(enum command_type command_type,
case MT_VIDEO: case MT_VIDEO:
ht = sdp_manipulations->subst_commands_video; ht = sdp_manipulations->subst_commands_video;
break; break;
default: /* MT_UNKNOWN */
case MT_UNKNOWN:
ht = sdp_manipulations->subst_commands_glob; ht = sdp_manipulations->subst_commands_glob;
break;
default:
break;
} }
str * l = ht ? g_hash_table_lookup(ht, attr_name) : NULL; 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; return 1;
break; break;
case CMD_ADD:;
case CMD_ADD:
switch (media_type) { switch (media_type) {
case MT_AUDIO: case MT_AUDIO:
q_ptr = &sdp_manipulations->add_commands_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: case MT_VIDEO:
q_ptr = &sdp_manipulations->add_commands_video; q_ptr = &sdp_manipulations->add_commands_video;
break; break;
default: /* MT_UNKNOWN */
case MT_UNKNOWN:
q_ptr = &sdp_manipulations->add_commands_glob; q_ptr = &sdp_manipulations->add_commands_glob;
break;
default:
break;
} }
if (q_ptr && q_ptr->head) if (q_ptr && q_ptr->head)
return 1; return 1;
break; break;
case CMD_REM:; case CMD_REM:;
ht = NULL;
if (!attr_name || !attr_name->len) if (!attr_name || !attr_name->len)
break; break;
@ -364,8 +358,11 @@ static int sdp_manipulate_check(enum command_type command_type,
case MT_VIDEO: case MT_VIDEO:
ht = sdp_manipulations->rem_commands_video; ht = sdp_manipulations->rem_commands_video;
break; break;
default: /* MT_UNKNOWN */
case MT_UNKNOWN:
ht = sdp_manipulations->rem_commands_glob; ht = sdp_manipulations->rem_commands_glob;
break;
default:
break;
} }
if (ht && g_hash_table_lookup(ht, attr_name)) if (ht && g_hash_table_lookup(ht, attr_name))
return 1; return 1;


Loading…
Cancel
Save