Fix HEVC streams requiring a higher bitrate to enable high quality surround audio
This commit is contained in:
parent
4c47dd74ad
commit
679f6e83bb
3 changed files with 5 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ AUDIO_RENDERER_CALLBACKS AudioCallbacks;
|
||||||
int NegotiatedVideoFormat;
|
int NegotiatedVideoFormat;
|
||||||
volatile int ConnectionInterrupted;
|
volatile int ConnectionInterrupted;
|
||||||
int HighQualitySurroundEnabled;
|
int HighQualitySurroundEnabled;
|
||||||
|
int OriginalVideoBitrate;
|
||||||
|
|
||||||
// Connection stages
|
// Connection stages
|
||||||
static const char* stageNames[STAGE_MAX] = {
|
static const char* stageNames[STAGE_MAX] = {
|
||||||
|
|
@ -223,6 +224,7 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre
|
||||||
|
|
||||||
NegotiatedVideoFormat = 0;
|
NegotiatedVideoFormat = 0;
|
||||||
memcpy(&StreamConfig, streamConfig, sizeof(StreamConfig));
|
memcpy(&StreamConfig, streamConfig, sizeof(StreamConfig));
|
||||||
|
OriginalVideoBitrate = streamConfig->bitrate;
|
||||||
RemoteAddrString = strdup(serverInfo->address);
|
RemoteAddrString = strdup(serverInfo->address);
|
||||||
|
|
||||||
// FEC only works in 16 byte chunks, so we must round down
|
// FEC only works in 16 byte chunks, so we must round down
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ extern AUDIO_RENDERER_CALLBACKS AudioCallbacks;
|
||||||
extern int NegotiatedVideoFormat;
|
extern int NegotiatedVideoFormat;
|
||||||
extern volatile int ConnectionInterrupted;
|
extern volatile int ConnectionInterrupted;
|
||||||
extern int HighQualitySurroundEnabled;
|
extern int HighQualitySurroundEnabled;
|
||||||
|
extern int OriginalVideoBitrate;
|
||||||
|
|
||||||
#ifndef UINT24_MAX
|
#ifndef UINT24_MAX
|
||||||
#define UINT24_MAX 0xFFFFFF
|
#define UINT24_MAX 0xFFFFFF
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,8 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppVersionQuad[0] >= 7) {
|
if (AppVersionQuad[0] >= 7) {
|
||||||
if (StreamConfig.bitrate > HIGH_BITRATE_THRESHOLD && audioChannelCount > 2) {
|
// Decide to use HQ audio based on the original video bitrate, not the HEVC-adjusted value
|
||||||
|
if (OriginalVideoBitrate >= HIGH_BITRATE_THRESHOLD && audioChannelCount > 2) {
|
||||||
// Enable high quality mode for surround sound
|
// Enable high quality mode for surround sound
|
||||||
err |= addAttributeString(&optionHead, "x-nv-audio.surround.AudioQuality", "1");
|
err |= addAttributeString(&optionHead, "x-nv-audio.surround.AudioQuality", "1");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue