Browse Source

MT#57550 Update `call_get_monologue_new()` to use media subs

During the `monologues_intact` stage of the `call_get_monologue_new()`
use media subscription in order to:
- update `os` ml, if still not set before
- update subscription ml's tag with totag, if not set before

After the first possible subscription's `offer/answer` ml
has been found and all work done, break cycling expecting
that this is one-to-one (so offer/answer) model, where only
medias of two monologues are involved.

Change-Id: I8b06cee2090563da4ce4c290ab3c0b9ce8c7ab3f
pull/1752/head
Donat Zenichev 2 years ago
parent
commit
84c8f156ea
1 changed files with 19 additions and 10 deletions
  1. +19
    -10
      daemon/call.c

+ 19
- 10
daemon/call.c View File

@ -4704,18 +4704,27 @@ new_branch:
__subscribe_matched_medias(ret, os); __subscribe_matched_medias(ret, os);
monologues_intact: monologues_intact:
for (GList *sub = ret->subscriptions.head; sub; sub = sub->next) {
struct call_subscription *cs = sub->data;
if (!cs->attrs.offer_answer)
for (unsigned int i = 0; i < ret->medias->len; i++)
{
struct call_media *media = ret->medias->pdata[i];
if (!media)
continue; continue;
struct call_monologue *csm = cs->monologue;
if (!os)
os = csm;
if (totag && totag->s && !csm->tag.s)
__monologue_tag(csm, totag);
break; // there should only be one
// XXX check if there's more than a one-to-one mapping here?
for (GList *l = media->media_subscriptions.head; l; l = l->next)
{
struct media_subscription * ms = l->data;
if (!ms->attrs.offer_answer)
continue;
if (!os)
os = ms->monologue;
if (totag && totag->s && !ms->monologue->tag.s)
__monologue_tag(ms->monologue, totag);
/* There should be only one monologue?
* TODO: check if there's more than one-to-one mapping */
goto monologues_intact_finalize;
}
} }
monologues_intact_finalize:
if (G_UNLIKELY(!os)) if (G_UNLIKELY(!os))
return -1; return -1;
__tags_associate(ret, os); __tags_associate(ret, os);


Loading…
Cancel
Save