From e21a8cf4d417581ab5d59846ebc0bcef251d5716 Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Tue, 10 Jan 2012 08:37:33 +0000 Subject: [PATCH] Fix issue 211: Make sure we always generate at least one FEC packet per frame if we need protection. BUG=211 TEST= Review URL: http://webrtc-codereview.appspot.com/348002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1363 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/rtp_rtcp/source/forward_error_correction.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/rtp_rtcp/source/forward_error_correction.cc b/src/modules/rtp_rtcp/source/forward_error_correction.cc index 4ca662b6b..3e0d4e34d 100644 --- a/src/modules/rtp_rtcp/source/forward_error_correction.cc +++ b/src/modules/rtp_rtcp/source/forward_error_correction.cc @@ -175,6 +175,11 @@ ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList, // Result in Q0 with an unsigned round. WebRtc_UWord32 numFecPackets = (numMediaPackets * protectionFactor + (1 << 7)) >> 8; + // Generate at least one FEC packet if we need protection. + if (protectionFactor > 0 && numFecPackets == 0) + { + numFecPackets = 1; + } if (numFecPackets == 0) { return 0;