fix SA1513/SA1516

This commit is contained in:
telans
2020-06-16 09:43:52 +12:00
parent 25f8e596cb
commit 247f9c61e6
283 changed files with 1810 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ namespace MediaBrowser.Model.Dlna
{
return Profile.MaxStaticMusicBitrate;
}
return Profile.MaxStaticBitrate;
}

View File

@@ -27,16 +27,25 @@ namespace MediaBrowser.Model.Dlna
public DeviceIdentification Identification { get; set; }
public string FriendlyName { get; set; }
public string Manufacturer { get; set; }
public string ManufacturerUrl { get; set; }
public string ModelName { get; set; }
public string ModelDescription { get; set; }
public string ModelNumber { get; set; }
public string ModelUrl { get; set; }
public string SerialNumber { get; set; }
public bool EnableAlbumArtInDidl { get; set; }
public bool EnableSingleAlbumArtLimit { get; set; }
public bool EnableSingleSubtitleLimit { get; set; }
public string SupportedMediaTypes { get; set; }
@@ -46,15 +55,19 @@ namespace MediaBrowser.Model.Dlna
public string AlbumArtPn { get; set; }
public int MaxAlbumArtWidth { get; set; }
public int MaxAlbumArtHeight { get; set; }
public int? MaxIconWidth { get; set; }
public int? MaxIconHeight { get; set; }
public long? MaxStreamingBitrate { get; set; }
public long? MaxStaticBitrate { get; set; }
public int? MusicStreamingTranscodingBitrate { get; set; }
public int? MaxStaticMusicBitrate { get; set; }
/// <summary>
@@ -65,10 +78,13 @@ namespace MediaBrowser.Model.Dlna
public string ProtocolInfo { get; set; }
public int TimelineOffsetSeconds { get; set; }
public bool RequiresPlainVideoItems { get; set; }
public bool RequiresPlainFolders { get; set; }
public bool EnableMSMediaReceiverRegistrar { get; set; }
public bool IgnoreTranscodeByteRangeRequests { get; set; }
public XmlAttribute[] XmlRootAttributes { get; set; }
@@ -88,6 +104,7 @@ namespace MediaBrowser.Model.Dlna
public ContainerProfile[] ContainerProfiles { get; set; }
public CodecProfile[] CodecProfiles { get; set; }
public ResponseProfile[] ResponseProfiles { get; set; }
public SubtitleProfile[] SubtitleProfiles { get; set; }
@@ -169,6 +186,7 @@ namespace MediaBrowser.Model.Dlna
return i;
}
return null;
}
@@ -209,6 +227,7 @@ namespace MediaBrowser.Model.Dlna
return i;
}
return null;
}
@@ -254,6 +273,7 @@ namespace MediaBrowser.Model.Dlna
return i;
}
return null;
}
@@ -318,6 +338,7 @@ namespace MediaBrowser.Model.Dlna
return i;
}
return null;
}
}

View File

@@ -107,6 +107,7 @@ namespace MediaBrowser.Model.Dlna
return list.ToArray();
}
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
{
if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
@@ -150,8 +151,10 @@ namespace MediaBrowser.Model.Dlna
{
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L2_AC3_ISO };
}
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
}
if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
{
suffix = string.Equals(suffix, "_ISO", StringComparison.OrdinalIgnoreCase) ? suffix : "_T";
@@ -190,10 +193,12 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.AVC_MP4_MP_SD_AC3;
}
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
{
return MediaFormatProfile.AVC_MP4_MP_SD_MPEG1_L3;
}
if (width.HasValue && height.HasValue)
{
if ((width.Value <= 720) && (height.Value <= 576))
@@ -277,6 +282,7 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.WMVMED_FULL;
}
return MediaFormatProfile.WMVMED_PRO;
}
}
@@ -285,6 +291,7 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.WMVHIGH_FULL;
}
return MediaFormatProfile.WMVHIGH_PRO;
}
@@ -342,6 +349,7 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.WMA_BASE;
}
return MediaFormatProfile.WMA_FULL;
}
@@ -353,14 +361,17 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.LPCM16_44_MONO;
}
if (frequency.Value == 44100 && channels.Value == 2)
{
return MediaFormatProfile.LPCM16_44_STEREO;
}
if (frequency.Value == 48000 && channels.Value == 1)
{
return MediaFormatProfile.LPCM16_48_MONO;
}
if (frequency.Value == 48000 && channels.Value == 2)
{
return MediaFormatProfile.LPCM16_48_STEREO;
@@ -378,6 +389,7 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.AAC_ISO_320;
}
return MediaFormatProfile.AAC_ISO;
}
@@ -387,6 +399,7 @@ namespace MediaBrowser.Model.Dlna
{
return MediaFormatProfile.AAC_ADTS_320;
}
return MediaFormatProfile.AAC_ADTS;
}

View File

@@ -627,10 +627,12 @@ namespace MediaBrowser.Model.Dlna
{
playlistItem.MinSegments = transcodingProfile.MinSegments;
}
if (transcodingProfile.SegmentLength > 0)
{
playlistItem.SegmentLength = transcodingProfile.SegmentLength;
}
playlistItem.SubProtocol = transcodingProfile.Protocol;
if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels)
@@ -947,6 +949,7 @@ namespace MediaBrowser.Model.Dlna
{
return (PlayMethod.DirectPlay, new List<TranscodeReason>());
}
if (options.ForceDirectStream)
{
return (PlayMethod.DirectStream, new List<TranscodeReason>());
@@ -1261,6 +1264,7 @@ namespace MediaBrowser.Model.Dlna
return true;
}
}
return false;
}
@@ -1363,14 +1367,17 @@ namespace MediaBrowser.Model.Dlna
{
throw new ArgumentException("ItemId is required");
}
if (string.IsNullOrEmpty(options.DeviceId))
{
throw new ArgumentException("DeviceId is required");
}
if (options.Profile == null)
{
throw new ArgumentException("Profile is required");
}
if (options.MediaSources == null)
{
throw new ArgumentException("MediaSources is required");
@@ -1418,6 +1425,7 @@ namespace MediaBrowser.Model.Dlna
item.AudioBitrate = Math.Max(num, item.AudioBitrate ?? num);
}
}
break;
}
case ProfileConditionValue.AudioChannels:
@@ -1452,6 +1460,7 @@ namespace MediaBrowser.Model.Dlna
item.SetOption(qualifier, "audiochannels", Math.Max(num, item.GetTargetAudioChannels(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
}
}
break;
}
case ProfileConditionValue.IsAvc:
@@ -1472,6 +1481,7 @@ namespace MediaBrowser.Model.Dlna
item.RequireAvc = true;
}
}
break;
}
case ProfileConditionValue.IsAnamorphic:
@@ -1492,6 +1502,7 @@ namespace MediaBrowser.Model.Dlna
item.RequireNonAnamorphic = true;
}
}
break;
}
case ProfileConditionValue.IsInterlaced:
@@ -1522,6 +1533,7 @@ namespace MediaBrowser.Model.Dlna
item.SetOption(qualifier, "deinterlace", "true");
}
}
break;
}
case ProfileConditionValue.AudioProfile:
@@ -1567,6 +1579,7 @@ namespace MediaBrowser.Model.Dlna
item.SetOption(qualifier, "maxrefframes", Math.Max(num, item.GetTargetRefFrames(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
}
}
break;
}
case ProfileConditionValue.VideoBitDepth:
@@ -1601,6 +1614,7 @@ namespace MediaBrowser.Model.Dlna
item.SetOption(qualifier, "videobitdepth", Math.Max(num, item.GetTargetVideoBitDepth(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
}
}
break;
}
case ProfileConditionValue.VideoProfile:
@@ -1623,6 +1637,7 @@ namespace MediaBrowser.Model.Dlna
item.SetOption(qualifier, "profile", string.Join(",", values));
}
}
break;
}
case ProfileConditionValue.Height:
@@ -1647,6 +1662,7 @@ namespace MediaBrowser.Model.Dlna
item.MaxHeight = Math.Max(num, item.MaxHeight ?? num);
}
}
break;
}
case ProfileConditionValue.VideoBitrate:
@@ -1671,6 +1687,7 @@ namespace MediaBrowser.Model.Dlna
item.VideoBitrate = Math.Max(num, item.VideoBitrate ?? num);
}
}
break;
}
case ProfileConditionValue.VideoFramerate:
@@ -1695,6 +1712,7 @@ namespace MediaBrowser.Model.Dlna
item.MaxFramerate = Math.Max(num, item.MaxFramerate ?? num);
}
}
break;
}
case ProfileConditionValue.VideoLevel:
@@ -1719,6 +1737,7 @@ namespace MediaBrowser.Model.Dlna
item.SetOption(qualifier, "level", Math.Max(num, item.GetTargetVideoLevel(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
}
}
break;
}
case ProfileConditionValue.Width:
@@ -1743,8 +1762,10 @@ namespace MediaBrowser.Model.Dlna
item.MaxWidth = Math.Max(num, item.MaxWidth ?? num);
}
}
break;
}
default:
break;
}

View File

@@ -69,6 +69,7 @@ namespace MediaBrowser.Model.Dlna
public Guid ItemId { get; set; }
public PlayMethod PlayMethod { get; set; }
public EncodingContext Context { get; set; }
public DlnaProfileType MediaType { get; set; }
@@ -80,15 +81,23 @@ namespace MediaBrowser.Model.Dlna
public long StartPositionTicks { get; set; }
public int? SegmentLength { get; set; }
public int? MinSegments { get; set; }
public bool BreakOnNonKeyFrames { get; set; }
public bool RequireAvc { get; set; }
public bool RequireNonAnamorphic { get; set; }
public bool CopyTimestamps { get; set; }
public bool EnableMpegtsM2TsMode { get; set; }
public bool EnableSubtitlesInManifest { get; set; }
public string[] AudioCodecs { get; set; }
public string[] VideoCodecs { get; set; }
public int? AudioStreamIndex { get; set; }
@@ -96,6 +105,7 @@ namespace MediaBrowser.Model.Dlna
public int? SubtitleStreamIndex { get; set; }
public int? TranscodingMaxAudioChannels { get; set; }
public int? GlobalMaxAudioChannels { get; set; }
public int? AudioBitrate { get; set; }
@@ -103,12 +113,15 @@ namespace MediaBrowser.Model.Dlna
public int? VideoBitrate { get; set; }
public int? MaxWidth { get; set; }
public int? MaxHeight { get; set; }
public float? MaxFramerate { get; set; }
public DeviceProfile DeviceProfile { get; set; }
public string DeviceProfileId { get; set; }
public string DeviceId { get; set; }
public long? RunTimeTicks { get; set; }
@@ -120,10 +133,13 @@ namespace MediaBrowser.Model.Dlna
public MediaSourceInfo MediaSource { get; set; }
public string[] SubtitleCodecs { get; set; }
public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; }
public string SubtitleFormat { get; set; }
public string PlaySessionId { get; set; }
public TranscodeReason[] TranscodeReasons { get; set; }
public Dictionary<string, string> StreamOptions { get; private set; }
@@ -160,11 +176,13 @@ namespace MediaBrowser.Model.Dlna
{
continue;
}
if (string.Equals(pair.Name, "SubtitleStreamIndex", StringComparison.OrdinalIgnoreCase) &&
string.Equals(pair.Value, "-1", StringComparison.OrdinalIgnoreCase))
{
continue;
}
if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
string.Equals(pair.Value, "false", StringComparison.OrdinalIgnoreCase))
{
@@ -993,6 +1011,7 @@ namespace MediaBrowser.Model.Dlna
{
return GetMediaStreamCount(MediaStreamType.Video, int.MaxValue);
}
return GetMediaStreamCount(MediaStreamType.Video, 1);
}
}
@@ -1005,6 +1024,7 @@ namespace MediaBrowser.Model.Dlna
{
return GetMediaStreamCount(MediaStreamType.Audio, int.MaxValue);
}
return GetMediaStreamCount(MediaStreamType.Audio, 1);
}
}