Browse Source

MT#56447 extend ice_update_media_streams()

Support media section lookup by media label (a:mid) as well as by media
section index number.

Change-Id: Iad87962b39d58956860e8fa8b88b4e1f3f61ded8
pull/1642/head
Richard Fuchs 3 years ago
parent
commit
da9bca8d9e
1 changed files with 13 additions and 6 deletions
  1. +13
    -6
      daemon/ice.c

+ 13
- 6
daemon/ice.c View File

@ -99,15 +99,22 @@ static GHashTable *sdp_fragments;
void ice_update_media_streams(struct call_monologue *ml, GQueue *streams) { void ice_update_media_streams(struct call_monologue *ml, GQueue *streams) {
unsigned int media_idx = 0;
for (GList *l = streams->head; l; l = l->next) { for (GList *l = streams->head; l; l = l->next) {
struct stream_params *sp = l->data; struct stream_params *sp = l->data;
if (media_idx >= ml->medias->len)
break;
struct call_media *media = ml->medias->pdata[media_idx++];
if (!media)
struct call_media *media = NULL;
if (sp->media_id.len)
media = g_hash_table_lookup(ml->media_ids, &sp->media_id);
else if (sp->index > 0) {
unsigned int arr_idx = sp->index - 1;
if (arr_idx < ml->medias->len)
media = ml->medias->pdata[arr_idx];
}
if (!media) {
ilogs(ice, LOG_WARN, "No matching media for trickle ICE update found");
continue; continue;
}
if (!media->ice_agent) { if (!media->ice_agent) {
ilogs(ice, LOG_WARN, "Media for trickle ICE update is not ICE-enabled"); ilogs(ice, LOG_WARN, "Media for trickle ICE update is not ICE-enabled");


Loading…
Cancel
Save