From 607e6fd44e8377be903e97268d4d9ea72d1048fb Mon Sep 17 00:00:00 2001 From: Amit Hilbuch Date: Thu, 17 Jan 2019 15:18:40 -0800 Subject: [PATCH] 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 Commit-Queue: Amit Hilbuch Cr-Commit-Position: refs/heads/master@{#26308} --- pc/media_session.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc/media_session.cc b/pc/media_session.cc index 99e7e4098d..9f3a7df1e1 100644 --- a/pc/media_session.cc +++ b/pc/media_session.cc @@ -425,11 +425,11 @@ static StreamParams CreateStreamParamsForNewSenderWithSsrcs( // Generate extra ssrc for include_flexfec_stream case. if (include_flexfec_stream) { // TODO(brandtr): Update when we support multistream protection. - if (result.ssrcs.size() == 1) { + if (primary_ssrcs.size() == 1) { for (uint32_t ssrc : primary_ssrcs) { result.AddFecFrSsrc(ssrc, ssrc_generator()); } - } else if (!result.ssrcs.empty()) { + } else if (!primary_ssrcs.empty()) { RTC_LOG(LS_WARNING) << "Our FlexFEC implementation only supports protecting " "a single media streams. This session has multiple "