diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-05-15 02:08:29 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2016-05-15 02:08:29 -0400 |
| commit | 398d6c80ccdadc5e44eef039784fc3beff9f6db8 (patch) | |
| tree | 2a4569b192459829f771211014d6dba097a32770 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | b91e10f91a395ae65b550b31cfb5a18857c55e0a (diff) | |
| parent | 2fffbc2db029f6731db924b73821338d5cf753d5 (diff) | |
Merge pull request #1734 from MediaBrowser/dev
fixes #1356 - [BUG] .mkv that stream copies, cannot be played without…
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 0f58a9db8..421ccdb5d 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -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); |
