Backport pull request #5972 from jellyfin-web/release-10.9.z

Apply Maximum Allowed Audio Channels to DirectPlay

Original-merge: 20ea6041a7

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
dmitrylyzo 2024-09-07 18:07:30 -04:00 committed by Joshua M. Boniface
parent cf9af1f392
commit 5e33b983a5

View File

@ -906,17 +906,45 @@ export default function (options) {
});
}
const globalAudioCodecProfileConditions = [];
const globalVideoAudioCodecProfileConditions = [];
if (parseInt(userSettings.allowedAudioChannels(), 10) > 0) {
globalAudioCodecProfileConditions.push({
Condition: 'LessThanEqual',
Property: 'AudioChannels',
Value: physicalAudioChannels.toString(),
IsRequired: false
});
globalVideoAudioCodecProfileConditions.push({
Condition: 'LessThanEqual',
Property: 'AudioChannels',
Value: physicalAudioChannels.toString(),
IsRequired: false
});
}
if (!supportsSecondaryAudio) {
profile.CodecProfiles.push({
Type: 'VideoAudio',
Conditions: [
{
globalVideoAudioCodecProfileConditions.push({
Condition: 'Equals',
Property: 'IsSecondaryAudio',
Value: 'false',
IsRequired: false
});
}
]
if (globalAudioCodecProfileConditions.length) {
profile.CodecProfiles.push({
Type: 'Audio',
Conditions: globalAudioCodecProfileConditions
});
}
if (globalVideoAudioCodecProfileConditions.length) {
profile.CodecProfiles.push({
Type: 'VideoAudio',
Conditions: globalVideoAudioCodecProfileConditions
});
}