1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #5972 from dmitrylyzo/max-audio-channels

Apply Maximum Allowed Audio Channels to DirectPlay
This commit is contained in:
Bill Thornton 2024-08-27 16:48:29 -04:00 committed by GitHub
commit 20ea6041a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -875,17 +875,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) {
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: [
{
Condition: 'Equals',
Property: 'IsSecondaryAudio',
Value: 'false',
IsRequired: false
}
]
Conditions: globalVideoAudioCodecProfileConditions
});
}