[Opalvoip-svn] SF.net SVN: opalvoip: [18726] opal/branches/csoutheren/devel
Brought to you by:
csoutheren,
rjongbloed
From: <cso...@us...> - 2007-10-22 11:26:03
|
Revision: 18726 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=18726&view=rev Author: csoutheren Date: 2007-10-22 04:26:06 -0700 (Mon, 22 Oct 2007) Log Message: ----------- Applied OpenH323 patch 1789256 - Fix handling of RTP packets with 'padding bit' set Thanke to Boris Pavacic Modified Paths: -------------- opal/branches/csoutheren/devel/include/rtp/rtp.h opal/branches/csoutheren/devel/src/rtp/rtp.cxx Modified: opal/branches/csoutheren/devel/include/rtp/rtp.h =================================================================== --- opal/branches/csoutheren/devel/include/rtp/rtp.h 2007-10-22 08:46:38 UTC (rev 18725) +++ opal/branches/csoutheren/devel/include/rtp/rtp.h 2007-10-22 11:26:06 UTC (rev 18726) @@ -443,6 +443,11 @@ BOOL GetMarker() const { return (theArray[1]&0x80) != 0; } void SetMarker(BOOL m); + BOOL GetPadding() const { return (theArray[0]&0x20) != 0; } + void SetPadding(BOOL v) { if (v) theArray[0] |= 0x20; else theArray[0] &= 0xdf; } + + unsigned GetPaddingSize() const; + PayloadTypes GetPayloadType() const { return (PayloadTypes)(theArray[1]&0x7f); } void SetPayloadType(PayloadTypes t); @@ -467,7 +472,7 @@ BOOL SetExtensionSize(PINDEX sz); BYTE * GetExtensionPtr() const; - PINDEX GetPayloadSize() const { return payloadSize; } + PINDEX GetPayloadSize() const { return payloadSize - GetPaddingSize(); } BOOL SetPayloadSize(PINDEX sz); BYTE * GetPayloadPtr() const { return (BYTE *)(theArray+GetHeaderSize()); } Modified: opal/branches/csoutheren/devel/src/rtp/rtp.cxx =================================================================== --- opal/branches/csoutheren/devel/src/rtp/rtp.cxx 2007-10-22 08:46:38 UTC (rev 18725) +++ opal/branches/csoutheren/devel/src/rtp/rtp.cxx 2007-10-22 11:26:06 UTC (rev 18726) @@ -765,6 +765,11 @@ strm << hex << setfill('0') << PBYTEArray(GetPayloadPtr(), GetPayloadSize(), false) << setfill(' ') << dec; } +unsigned RTP_DataFrame::GetPaddingSize() const +{ + if (!GetPadding()) return 0; + return PMAX(0, GetPayloadPtr()[payloadSize-1]); +} #if PTRACING static const char * const PayloadTypesNames[RTP_DataFrame::LastKnownPayloadType] = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |