aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-14 23:52:39 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-14 23:52:39 -0400
commit2fffbc2db029f6731db924b73821338d5cf753d5 (patch)
tree4a9094f74850d4267371ffabe2ed8ecda717a5dd
parentff980dc42c4ebc31151a3dd4bc4d8dac738fd801 (diff)
fixes #1356 - [BUG] .mkv that stream copies, cannot be played without transcoding option turned on for user
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs15
-rw-r--r--MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs7
2 files changed, 15 insertions, 7 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);
diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
index a47fcdf4f..0ef7efe1b 100644
--- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
@@ -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;
- }
- }
}
}