mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-27 10:58:44 +01:00
Refactor copy codec checks
This commit is contained in:
@@ -193,7 +193,7 @@ namespace MediaBrowser.Api.Playback
|
||||
|
||||
await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);
|
||||
|
||||
if (state.VideoRequest != null && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
if (state.VideoRequest != null && !EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
|
||||
{
|
||||
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
|
||||
if (auth.User != null && !auth.User.Policy.EnableVideoPlaybackTranscoding)
|
||||
@@ -243,9 +243,9 @@ namespace MediaBrowser.Api.Playback
|
||||
|
||||
var logFilePrefix = "ffmpeg-transcode";
|
||||
if (state.VideoRequest != null
|
||||
&& string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
&& EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
|
||||
{
|
||||
logFilePrefix = string.Equals(state.OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase)
|
||||
logFilePrefix = EncodingHelper.IsCopyCodec(state.OutputAudioCodec)
|
||||
? "ffmpeg-remux" : "ffmpeg-directstream";
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ namespace MediaBrowser.Api.Playback
|
||||
state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks &&
|
||||
state.IsInputVideo &&
|
||||
state.VideoType == VideoType.VideoFile &&
|
||||
!string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase);
|
||||
!EncodingHelper.IsCopyCodec(state.OutputVideoCodec);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -791,7 +791,7 @@ namespace MediaBrowser.Api.Playback
|
||||
EncodingHelper.TryStreamCopy(state);
|
||||
}
|
||||
|
||||
if (state.OutputVideoBitrate.HasValue && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
if (state.OutputVideoBitrate.HasValue && !EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
|
||||
{
|
||||
var resolution = ResolutionNormalizer.Normalize(
|
||||
state.VideoStream?.BitRate,
|
||||
|
||||
Reference in New Issue
Block a user