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

Apply Maximum Allowed Audio Channels to DirectPlay

This commit is contained in:
Dmitry Lyzo 2024-08-26 22:23:46 +03:00
parent 7949ff4f0a
commit 7807f8f062

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) {
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
});
}