Skip to content

Commit

Permalink
Adjust the requested packet size to account for the encryption header
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Jan 15, 2024
1 parent 06f18be commit 298f356
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SdpGenerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) {
snprintf(payloadStr, sizeof(payloadStr), "%d", StreamConfig.fps);
err |= addAttributeString(&optionHead, "x-nv-video[0].maxFPS", payloadStr);

// Adjust the video packet size to account for encryption overhead
if (EncryptionFeaturesEnabled & SS_ENC_VIDEO) {
LC_ASSERT(StreamConfig.packetSize % 16 == 0);
StreamConfig.packetSize -= sizeof(ENC_VIDEO_HEADER);
LC_ASSERT(StreamConfig.packetSize % 16 == 0);
}
snprintf(payloadStr, sizeof(payloadStr), "%d", StreamConfig.packetSize);
err |= addAttributeString(&optionHead, "x-nv-video[0].packetSize", payloadStr);

Expand Down

0 comments on commit 298f356

Please sign in to comment.