Skip to content

Commit

Permalink
Backport pull request #5972 from jellyfin-web/release-10.9.z
Browse files Browse the repository at this point in the history
Apply Maximum Allowed Audio Channels to DirectPlay

Original-merge: 20ea604

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

Backported-by: Joshua M. Boniface <joshua@boniface.me>
  • Loading branch information
dmitrylyzo authored and joshuaboniface committed Sep 7, 2024
1 parent cf9af1f commit 5e33b98
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions src/scripts/browserDeviceProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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
});
}

Expand Down

0 comments on commit 5e33b98

Please sign in to comment.