aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-07-01 12:24:26 -0400
committerGitHub <noreply@github.com>2017-07-01 12:24:26 -0400
commitff3713153ad2317e1c196f33ac2cba61b449a00e (patch)
tree84d2e6ed5bcb556a2395603b6403c8e992535e6b /MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
parentfad71a6c7d12c8b207cdf473c7dd7daafa53c174 (diff)
parent2dcad6b5977f5c5be81b18c42506ed8ad3fb73b6 (diff)
Merge pull request #2739 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs')
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs45
1 files changed, 44 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 57c81ddf7..b552579a8 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
@@ -9,6 +10,7 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Drawing;
+using MediaBrowser.Model.Session;
namespace MediaBrowser.Controller.MediaEncoding
{
@@ -40,6 +42,24 @@ namespace MediaBrowser.Controller.MediaEncoding
public bool ReadInputAtNativeFramerate { get; set; }
+ private List<TranscodeReason> _transcodeReasons = null;
+ public List<TranscodeReason> TranscodeReasons
+ {
+ get
+ {
+ if (_transcodeReasons == null)
+ {
+ _transcodeReasons = (BaseRequest.TranscodeReasons ?? string.Empty)
+ .Split(',')
+ .Where(i => !string.IsNullOrWhiteSpace(i))
+ .Select(v => (TranscodeReason)Enum.Parse(typeof(TranscodeReason), v, true))
+ .ToList();
+ }
+
+ return _transcodeReasons;
+ }
+ }
+
public bool IgnoreInputDts
{
get
@@ -251,7 +271,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return AudioStream.SampleRate;
}
- }
+ }
else if (BaseRequest.AudioSampleRate.HasValue)
{
@@ -264,6 +284,29 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
+ public int? OutputAudioBitDepth
+ {
+ get
+ {
+ if (BaseRequest.Static || string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ {
+ if (AudioStream != null)
+ {
+ return AudioStream.BitDepth;
+ }
+ }
+
+ //else if (BaseRequest.AudioSampleRate.HasValue)
+ //{
+ // // Don't exceed what the encoder supports
+ // // Seeing issues of attempting to encode to 88200
+ // return Math.Min(44100, BaseRequest.AudioSampleRate.Value);
+ //}
+
+ return null;
+ }
+ }
+
/// <summary>
/// Predicts the audio sample rate that will be in the output stream
/// </summary>