Browse Source

MT#58441 sdp attr rem/subst goes to the bottom

Move processing of removal and substitution
attribute manipulations to the bottom,
after all fixed (well known to rtpengine)
attributes are skipped already.

This is done for media and session level attributes:
- `process_media_attributes()`
- `process_session_attributes()`

This is to add an efficiency to the current processing,
and not do double work.

Change-Id: Idd933f9d85aef5e9a5d597f8825d21e45f43ef37
pull/1747/head
Donat Zenichev 2 years ago
parent
commit
86b64ba4fc
1 changed files with 18 additions and 18 deletions
  1. +18
    -18
      daemon/sdp.c

+ 18
- 18
daemon/sdp.c View File

@ -2263,15 +2263,6 @@ static int process_session_attributes(struct sdp_chopper *chop, struct sdp_attri
struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, MT_UNKNOWN); struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, MT_UNKNOWN);
/* if attr is supposed to be removed don't add to the chop->output */
if (sdp_manipulate_remove(sdp_manipulations, &attr->line_value))
goto strip;
/* if attr is supposed to be substituted don't add to the chop->output, but add another value */
str *subst_str = sdp_manipulations_subst(sdp_manipulations, &attr->line_value);
if (subst_str)
goto strip_with_subst;
switch (attr->attr) { switch (attr->attr) {
case ATTR_ICE: case ATTR_ICE:
case ATTR_ICE_UFRAG: case ATTR_ICE_UFRAG:
@ -2324,6 +2315,15 @@ static int process_session_attributes(struct sdp_chopper *chop, struct sdp_attri
break; break;
} }
/* if attr is supposed to be removed don't add to the chop->output */
if (sdp_manipulate_remove(sdp_manipulations, &attr->line_value))
goto strip;
/* if attr is supposed to be substituted don't add to the chop->output, but add another value */
str *subst_str = sdp_manipulations_subst(sdp_manipulations, &attr->line_value);
if (subst_str)
goto strip_with_subst;
continue; continue;
strip: strip:
@ -2362,15 +2362,6 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media *
struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags,
sdp->media_type_id); sdp->media_type_id);
/* if attr is supposed to be removed don't add to the chop->output */
if (sdp_manipulate_remove(sdp_manipulations, &attr->line_value))
goto strip;
/* if attr is supposed to be substituted don't add to the chop->output, but add another value */
str *subst_str = sdp_manipulations_subst(sdp_manipulations, &attr->line_value);
if (subst_str)
goto strip_with_subst;
// protocol-agnostic attributes // protocol-agnostic attributes
switch (attr->attr) { switch (attr->attr) {
case ATTR_ICE: case ATTR_ICE:
@ -2463,6 +2454,15 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media *
break; break;
} }
/* if attr is supposed to be removed don't add to the chop->output */
if (sdp_manipulate_remove(sdp_manipulations, &attr->line_value))
goto strip;
/* if attr is supposed to be substituted don't add to the chop->output, but add another value */
str *subst_str = sdp_manipulations_subst(sdp_manipulations, &attr->line_value);
if (subst_str)
goto strip_with_subst;
continue; continue;
strip: strip:


Loading…
Cancel
Save