mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-17 15:46:22 +00:00
improve direct play to transcoding fallback
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user