mirror of
https://github.com/jellyfin/jellyfin
synced 2024-09-06 08:04:44 +00:00
fixes #1356 - [BUG] .mkv that stream copies, cannot be played without transcoding option turned on for user
This commit is contained in:
parent
ff980dc42c
commit
2fffbc2db0
|
@ -962,6 +962,21 @@ namespace MediaBrowser.Api.Playback
|
|||
|
||||
await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);
|
||||
|
||||
if (state.VideoRequest != null && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
|
||||
if (!string.IsNullOrWhiteSpace(auth.UserId))
|
||||
{
|
||||
var user = UserManager.GetUserById(auth.UserId);
|
||||
if (!user.Policy.EnableVideoPlaybackTranscoding)
|
||||
{
|
||||
ApiEntryPoint.Instance.OnTranscodeFailedToStart(outputPath, TranscodingJobType, state);
|
||||
|
||||
throw new ArgumentException("User does not have access to video transcoding");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var transcodingId = Guid.NewGuid().ToString("N");
|
||||
var commandLineArgs = GetCommandLineArguments(outputPath, state, true);
|
||||
|
||||
|
|
|
@ -175,13 +175,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
source.SupportsTranscoding = false;
|
||||
}
|
||||
}
|
||||
else if (string.Equals(item.MediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (!user.Policy.EnableVideoPlaybackTranscoding)
|
||||
{
|
||||
source.SupportsTranscoding = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue