Fixing possible bug when Flex and RTX used together.

When Flex and RTX are both specified, Flex will not be used because
RTX will introduce a new SSRC making the total SSRC count > 1.
Flex can only protect a single stream, so if the total SSRC count
is > 1, it is not used.
The fix is simple, to check the number of "primary SSRCs" before
redundancy streams are added when determining if Flex should be used.

Bug: None
Change-Id: I98df1b807d306bdcce1a76dfb163aa14e60d0052
Reviewed-on: https://webrtc-review.googlesource.com/c/118220
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26308}
This commit is contained in:
Amit Hilbuch
2019-01-17 15:18:40 -08:00
committed by Commit Bot
parent 01120bc1c1
commit 607e6fd44e

View File

@ -425,11 +425,11 @@ static StreamParams CreateStreamParamsForNewSenderWithSsrcs(
// Generate extra ssrc for include_flexfec_stream case. // Generate extra ssrc for include_flexfec_stream case.
if (include_flexfec_stream) { if (include_flexfec_stream) {
// TODO(brandtr): Update when we support multistream protection. // TODO(brandtr): Update when we support multistream protection.
if (result.ssrcs.size() == 1) { if (primary_ssrcs.size() == 1) {
for (uint32_t ssrc : primary_ssrcs) { for (uint32_t ssrc : primary_ssrcs) {
result.AddFecFrSsrc(ssrc, ssrc_generator()); result.AddFecFrSsrc(ssrc, ssrc_generator());
} }
} else if (!result.ssrcs.empty()) { } else if (!primary_ssrcs.empty()) {
RTC_LOG(LS_WARNING) RTC_LOG(LS_WARNING)
<< "Our FlexFEC implementation only supports protecting " << "Our FlexFEC implementation only supports protecting "
"a single media streams. This session has multiple " "a single media streams. This session has multiple "