Skip to content

Commit

Permalink
cleanup. Goodnight.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius Friedman committed Nov 25, 2023
1 parent 5851709 commit ee7aea9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Rtp/RtpClient.Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,11 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i

if (received <= 0 || sessionRequired < 0 || received < sessionRequired) return -1;

//The amount of data needed for the frame comes from TryReadFrameHeader
bool isInterleaved = sessionRequired >= InterleavedOverhead;

//When there was something to delemit the frames then we can do a quick search for it.
if(sessionRequired >= InterleavedOverhead)
if (isInterleaved)
{
//Look for the frame control octet
int startOfFrame = System.Array.IndexOf(buffer, BigEndianFrameControl, bufferOffset, received);
Expand Down Expand Up @@ -1257,8 +1260,6 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i
}
}

//The amount of data needed for the frame comes from TryReadFrameHeader
bool isInterleaved = sessionRequired >= InterleavedOverhead;
int frameLength = TryReadFrameHeader(buffer, bufferOffset, out frameChannel, isInterleaved ? BigEndianFrameControl : null, isInterleaved, sessionRequired);

//Assign a context if there is a frame of any size
Expand All @@ -1272,6 +1273,9 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i
}
else if (frameLength >= 0) //Have to determine context by inspecting packet headers...
{
//Increase the result by the size of the header
frameLength += sessionRequired;

#region Verify Packet Headers

//Use CommonHeaderBits on the data after the Interleaved Frame Header
Expand Down

0 comments on commit ee7aea9

Please sign in to comment.