Skip to content

Commit

Permalink
cleanup / qol
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusfriedman committed Nov 21, 2023
1 parent c4a21c8 commit 7ad3361
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions Rtp/RtpClient.Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,7 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i
//Could ensure version here to make reception more unified.

//Just use the payload type to avoid confusion, payload types for Rtcp and Rtp cannot and should not overlap
parseRtcp = false.Equals(parseRtp = false.Equals(Media.Common.IDisposedExtensions.IsNullOrDisposed(GetContextByPayloadType(header.RtpPayloadType))));
parseRtcp = (parseRtp = Media.Common.IDisposedExtensions.IsNullOrDisposed(GetContextByPayloadType(header.RtpPayloadType)) is false) is false;

//Could also lookup the ssrc
}
Expand All @@ -2060,34 +2060,17 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i
//If rtcp should be parsed
if (parseRtcp && mRemaining >= Rtcp.RtcpHeader.Length)
{
//Iterate the packets within the buffer, calling Dispose on each packet
foreach (Rtcp.RtcpPacket rtcp in Rtcp.RtcpPacket.GetPackets(memory.Array, offset + index, Common.Binary.Min(ref mRemaining, ref count)))
{
//Handle the packet further (could indicate truncated here)
HandleIncomingRtcpPacket(this, rtcp);

//using (var tempHeader = new Rtp.RtpHeader(memory.Array, offset + index + 4))
//{
////Ensure Rtp...
//if (Common.IDisposedExtensions.IsNullOrDisposed(GetContextBySourceId(tempHeader.SynchronizationSourceIdentifier)))
//{

//Iterate the packets within the buffer, calling Dispose on each packet
foreach (Rtcp.RtcpPacket rtcp in Rtcp.RtcpPacket.GetPackets(memory.Array, offset + index, Common.Binary.Min(ref mRemaining, ref count)))
{
//Handle the packet further (could indicate truncated here)
HandleIncomingRtcpPacket(this, rtcp);

//Move the offset the length of the packet parsed
index += rtcp.Length;

mRemaining -= rtcp.Length;
}
//}
//else
//{

// offset += 4;
// mRemaining -= 4;
// goto Rtp;
//Move the offset the length of the packet parsed
index += rtcp.Length;

//}
//}
mRemaining -= rtcp.Length;
}
}

//Rtp:
Expand Down

0 comments on commit 7ad3361

Please sign in to comment.