Skip to content

Commit

Permalink
Merge pull request #5972 from dmitrylyzo/max-audio-channels
Browse files Browse the repository at this point in the history
Apply Maximum Allowed Audio Channels to DirectPlay
  • Loading branch information
thornbill authored Aug 27, 2024
2 parents ef00d43 + 7807f8f commit 20ea604
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 @@ -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
});
}

Expand Down

0 comments on commit 20ea604

Please sign in to comment.