Skip to content

Commit 5e33b98

Browse files
dmitrylyzojoshuaboniface
authored andcommitted
Backport pull request #5972 from jellyfin-web/release-10.9.z
Apply Maximum Allowed Audio Channels to DirectPlay Original-merge: 20ea604 Merged-by: thornbill <[email protected]> Backported-by: Joshua M. Boniface <[email protected]>
1 parent cf9af1f commit 5e33b98

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

src/scripts/browserDeviceProfile.js

+36-8
Original file line numberDiff line numberDiff line change
@@ -906,17 +906,45 @@ export default function (options) {
906906
});
907907
}
908908

909+
const globalAudioCodecProfileConditions = [];
910+
const globalVideoAudioCodecProfileConditions = [];
911+
912+
if (parseInt(userSettings.allowedAudioChannels(), 10) > 0) {
913+
globalAudioCodecProfileConditions.push({
914+
Condition: 'LessThanEqual',
915+
Property: 'AudioChannels',
916+
Value: physicalAudioChannels.toString(),
917+
IsRequired: false
918+
});
919+
920+
globalVideoAudioCodecProfileConditions.push({
921+
Condition: 'LessThanEqual',
922+
Property: 'AudioChannels',
923+
Value: physicalAudioChannels.toString(),
924+
IsRequired: false
925+
});
926+
}
927+
909928
if (!supportsSecondaryAudio) {
929+
globalVideoAudioCodecProfileConditions.push({
930+
Condition: 'Equals',
931+
Property: 'IsSecondaryAudio',
932+
Value: 'false',
933+
IsRequired: false
934+
});
935+
}
936+
937+
if (globalAudioCodecProfileConditions.length) {
938+
profile.CodecProfiles.push({
939+
Type: 'Audio',
940+
Conditions: globalAudioCodecProfileConditions
941+
});
942+
}
943+
944+
if (globalVideoAudioCodecProfileConditions.length) {
910945
profile.CodecProfiles.push({
911946
Type: 'VideoAudio',
912-
Conditions: [
913-
{
914-
Condition: 'Equals',
915-
Property: 'IsSecondaryAudio',
916-
Value: 'false',
917-
IsRequired: false
918-
}
919-
]
947+
Conditions: globalVideoAudioCodecProfileConditions
920948
});
921949
}
922950

0 commit comments

Comments
 (0)