improve direct play to transcoding fallback

This commit is contained in:
Luke Pulverenti
2017-03-31 15:50:55 -04:00
parent 06394d1a9f
commit 8d1ca8ca27
7 changed files with 50 additions and 10 deletions

View File

@@ -188,6 +188,14 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return null;
}
if (string.Equals(container, "ogm", StringComparison.OrdinalIgnoreCase))
{
return null;
}
if (string.Equals(container, "divx", StringComparison.OrdinalIgnoreCase))
{
return null;
}
// Seeing reported failures here, not sure yet if this is related to specfying input format
if (string.Equals(container, "m4v", StringComparison.OrdinalIgnoreCase))
@@ -750,6 +758,11 @@ namespace MediaBrowser.Controller.MediaEncoding
var request = state.BaseRequest;
if (!request.AllowVideoStreamCopy)
{
return false;
}
if (videoStream.IsInterlaced)
{
if (request.DeInterlace)
@@ -895,6 +908,11 @@ namespace MediaBrowser.Controller.MediaEncoding
var request = state.BaseRequest;
if (!request.AllowAudioStreamCopy)
{
return false;
}
// Source and target codecs must match
if (string.IsNullOrEmpty(audioStream.Codec) || !supportedAudioCodecs.Contains(audioStream.Codec, StringComparer.OrdinalIgnoreCase))
{

View File

@@ -72,6 +72,9 @@ namespace MediaBrowser.Controller.MediaEncoding
[ApiMember(Name = "EnableAutoStreamCopy", Description = "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool EnableAutoStreamCopy { get; set; }
public bool AllowVideoStreamCopy { get; set; }
public bool AllowAudioStreamCopy { get; set; }
/// <summary>
/// Gets or sets the audio sample rate.
/// </summary>
@@ -218,6 +221,8 @@ namespace MediaBrowser.Controller.MediaEncoding
public BaseEncodingJobOptions()
{
EnableAutoStreamCopy = true;
AllowVideoStreamCopy = true;
AllowAudioStreamCopy = true;
Context = EncodingContext.Streaming;
}
}