Replace AUDIO_CONFIGURATION constants with MAKE_AUDIO_CONFIGURATION() macro

This commit is contained in:
Cameron Gutman
2020-03-31 21:33:34 -07:00
parent fb60ae6a4d
commit 607aaca93f
5 changed files with 33 additions and 22 deletions

View File

@@ -178,6 +178,14 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre
OriginalVideoBitrate = streamConfig->bitrate;
RemoteAddrString = strdup(serverInfo->address);
// Validate the audio configuration
if (MAGIC_BYTE_FROM_AUDIO_CONFIG(StreamConfig.audioConfiguration) != 0xCA ||
CHANNEL_COUNT_FROM_AUDIO_CONFIGURATION(StreamConfig.audioConfiguration) > AUDIO_CONFIGURATION_MAX_CHANNEL_COUNT) {
Limelog("Invalid audio configuration specified\n");
err = -1;
goto Cleanup;
}
// FEC only works in 16 byte chunks, so we must round down
// the given packet size to the nearest multiple of 16.
StreamConfig.packetSize -= StreamConfig.packetSize % 16;