Merge pull request #7198 from dmitrylyzo/transcode-conditions

This commit is contained in:
Joshua M. Boniface 2022-03-25 10:11:45 -04:00 committed by GitHub
commit 8197e5921e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -699,6 +699,11 @@ namespace MediaBrowser.Model.Dlna
if (playlistItem.PlayMethod != PlayMethod.DirectPlay)
{
playlistItem.PlayMethod = PlayMethod.Transcode;
if ((playlistItem.TranscodeReasons & (VideoReasons | TranscodeReason.ContainerBitrateExceedsLimit)) != 0)
{
ApplyTranscodingConditions(playlistItem, transcodingProfile.Conditions, null, true, true);
}
}
}
}

View File

@ -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<ProfileCondition>();
}
[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);