From 1fe82d0debd1b3b126387113715944e9c42e866a Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sun, 16 Jan 2022 22:19:39 +0300 Subject: [PATCH] Add TranscodingProfile conditions --- MediaBrowser.Model/Dlna/StreamBuilder.cs | 1 + MediaBrowser.Model/Dlna/TranscodingProfile.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index a0fe3867e..9425e282a 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -699,6 +699,7 @@ namespace MediaBrowser.Model.Dlna if (playlistItem.PlayMethod != PlayMethod.DirectPlay) { playlistItem.PlayMethod = PlayMethod.Transcode; + ApplyTranscodingConditions(playlistItem, transcodingProfile.Conditions, null, true, true); } } } diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index 709bdad31..b4f6ec255 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -1,5 +1,6 @@ #pragma warning disable CS1591 +using System; using System.ComponentModel; using System.Xml.Serialization; @@ -7,6 +8,11 @@ namespace MediaBrowser.Model.Dlna { public class TranscodingProfile { + public TranscodingProfile() + { + Conditions = Array.Empty(); + } + [XmlAttribute("container")] public string Container { get; set; } = string.Empty; @@ -61,6 +67,8 @@ namespace MediaBrowser.Model.Dlna [XmlAttribute("breakOnNonKeyFrames")] public bool BreakOnNonKeyFrames { get; set; } + public ProfileCondition[] Conditions { get; set; } + public string[] GetAudioCodecs() { return ContainerProfile.SplitValue(AudioCodec);