diff options
Diffstat (limited to 'MediaBrowser.Model/Dlna/ConditionProcessor.cs')
| -rw-r--r-- | MediaBrowser.Model/Dlna/ConditionProcessor.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index ec13cacfa..6628e290e 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -1,6 +1,7 @@ using MediaBrowser.Model.Extensions; using MediaBrowser.Model.MediaInfo; using System; +using System.Globalization; namespace MediaBrowser.Model.Dlna { @@ -86,8 +87,8 @@ namespace MediaBrowser.Model.Dlna } } - public bool IsVideoAudioConditionSatisfied(ProfileCondition condition, - int? audioChannels, + public bool IsVideoAudioConditionSatisfied(ProfileCondition condition, + int? audioChannels, int? audioBitrate, string audioProfile, bool? isSecondaryTrack) @@ -116,7 +117,7 @@ namespace MediaBrowser.Model.Dlna } int expected; - if (IntHelper.TryParseCultureInvariant(condition.Value, out expected)) + if (int.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out expected)) { switch (condition.Condition) { @@ -149,9 +150,9 @@ namespace MediaBrowser.Model.Dlna switch (condition.Condition) { case ProfileConditionType.EqualsAny: - { - return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue); - } + { + return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue); + } case ProfileConditionType.Equals: return StringHelper.EqualsIgnoreCase(currentValue, expected); case ProfileConditionType.NotEquals: @@ -214,7 +215,7 @@ namespace MediaBrowser.Model.Dlna return false; } - + private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue) { if (!currentValue.HasValue) @@ -243,7 +244,7 @@ namespace MediaBrowser.Model.Dlna return false; } - + private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp) { if (!timestamp.HasValue) @@ -251,9 +252,9 @@ namespace MediaBrowser.Model.Dlna // If the value is unknown, it satisfies if not marked as required return !condition.IsRequired; } - + TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); - + switch (condition.Condition) { case ProfileConditionType.Equals: |
