File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1084,14 +1084,20 @@ static Codecs MatchCodecPreference(
1084
1084
break ;
1085
1085
}
1086
1086
} else if (IsRedCodec (codec)) {
1087
+ // For RED, do not insert the codec again if it was already
1088
+ // inserted. audio/red for opus gets enabled by having RED before
1089
+ // the primary codec.
1087
1090
const auto fmtp =
1088
1091
codec.params .find (cricket::kCodecParamNotInNameValueFormat );
1089
1092
if (fmtp != codec.params .end ()) {
1090
1093
std::vector<std::string> redundant_payloads;
1091
1094
rtc::split (fmtp->second , ' /' , &redundant_payloads);
1092
1095
if (redundant_payloads.size () > 0 &&
1093
1096
redundant_payloads[0 ] == id) {
1094
- filtered_codecs.push_back (codec);
1097
+ if (std::find (filtered_codecs.begin (), filtered_codecs.end (),
1098
+ codec) == filtered_codecs.end ()) {
1099
+ filtered_codecs.push_back (codec);
1100
+ }
1095
1101
break ;
1096
1102
}
1097
1103
}
You can’t perform that action at this time.
0 commit comments