mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
add ios dts workaround
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
@@ -22,12 +24,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? numVideoStreams,
|
||||
int? numAudioStreams,
|
||||
string videoCodecTag,
|
||||
bool? isAvc)
|
||||
bool? isAvc,
|
||||
List<string> allAudioCodecs )
|
||||
{
|
||||
switch (condition.Property)
|
||||
{
|
||||
case ProfileConditionValue.IsAnamorphic:
|
||||
return IsConditionSatisfied(condition, isAnamorphic);
|
||||
case ProfileConditionValue.HasAudioCodec:
|
||||
return IsHasAudioCodecConditionSatisfied(condition, allAudioCodecs);
|
||||
case ProfileConditionValue.IsAvc:
|
||||
return IsConditionSatisfied(condition, isAvc);
|
||||
case ProfileConditionValue.VideoFramerate:
|
||||
@@ -162,6 +167,25 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsHasAudioCodecConditionSatisfied(ProfileCondition condition, List<string> allAudioCodecs)
|
||||
{
|
||||
if (allAudioCodecs.Count == 0)
|
||||
{
|
||||
// If the value is unknown, it satisfies if not marked as required
|
||||
return !condition.IsRequired;
|
||||
}
|
||||
|
||||
switch (condition.Condition)
|
||||
{
|
||||
case ProfileConditionType.Equals:
|
||||
return allAudioCodecs.Contains(condition.Value, StringComparer.Ordinal);
|
||||
case ProfileConditionType.NotEquals:
|
||||
return !allAudioCodecs.Contains(condition.Value, StringComparer.Ordinal);
|
||||
default:
|
||||
throw new InvalidOperationException("Unexpected ProfileConditionType");
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)
|
||||
{
|
||||
if (!currentValue.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user