From 023abafa4e90e9c5e5dfb2ed5d81b4519377170f Mon Sep 17 00:00:00 2001 From: "marpan@google.com" Date: Thu, 16 Jun 2011 23:00:40 +0000 Subject: [PATCH] Modified the FEC to allow for option of unequal protection (UEP) across packets. Added two files under testFec, removed old testFec.cpp, and added two new files for generating packet masks: _internal.cc/h. Review URL: http://webrtc-codereview.appspot.com/26003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@94 4adac7df-926f-26a2-2b94-8c16560cd09d --- modules/rtp_rtcp/source/forward_error_correction.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/rtp_rtcp/source/forward_error_correction.cc b/modules/rtp_rtcp/source/forward_error_correction.cc index 16f8c3368..9156da629 100644 --- a/modules/rtp_rtcp/source/forward_error_correction.cc +++ b/modules/rtp_rtcp/source/forward_error_correction.cc @@ -198,7 +198,7 @@ ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList, } // -- Generate packet masks -- - WebRtc_UWord8 packetMask[numFecPackets * numMaskBytes]; + WebRtc_UWord8* packetMask = new WebRtc_UWord8[numFecPackets * numMaskBytes]; memset(packetMask, 0, numFecPackets * numMaskBytes); internal::GeneratePacketMasks(numMediaPackets, numFecPackets, numImportantPackets, packetMask); @@ -285,6 +285,7 @@ ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList, WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id, "Packet mask has row of zeros %d %d", numMediaPackets, numFecPackets); + delete packetMask; return -1; } @@ -342,7 +343,7 @@ ForwardErrorCorrection::GenerateFEC(const ListWrapper& mediaPacketList, memcpy(&_generatedFecPackets[i].data[12], &packetMask[i * numMaskBytes], numMaskBytes); } - + delete packetMask; return 0; }