Skip to content

Commit

Permalink
Handle padding in RTP packet.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngraziano committed Jul 5, 2023
1 parent f75158b commit 4f48626
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions RtspClientExample/RTSPClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ public void Rtp_DataReceived(object sender, Rtsp.RtspChunkEventArgs e)
+ " SSRC=" + rtp_ssrc
+ " Size=" + e.Message.Data.Length);

if(rtp_padding == 1)
{
int paddingCount = e.Message.Data[e.Message.Data.Length - 1];
_logger.Debug("Padding Count=" + paddingCount);
e.Message.Data = e.Message.Data.Take(e.Message.Data.Length - paddingCount).ToArray();
}


// Check the payload type in the RTP packet matches the Payload Type value from the SDP
if (data_received.Channel == video_data_channel && rtp_payload_type != video_payload)
Expand Down

0 comments on commit 4f48626

Please sign in to comment.