aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-30 15:22:35 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-30 15:22:35 -0400
commit235d341524cfc3f65fea6617a3fd51840ea1a130 (patch)
treec91310216a87052c24de7e9199474d0638272f31
parent62b0c2605f66f319d093ac6feb5a0d52d7c4aafb (diff)
force audio stream copy when audio transcoding is not allowed
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index ce3691095..ab73aabe4 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -1788,6 +1788,19 @@ namespace MediaBrowser.Api.Playback
{
state.OutputAudioCodec = "copy";
}
+ else
+ {
+ // If the user doesn't have access to transcoding, then force stream copy, regardless of whether it will be compatible or not
+ var auth = AuthorizationContext.GetAuthorizationInfo(Request);
+ if (!string.IsNullOrWhiteSpace(auth.UserId))
+ {
+ var user = UserManager.GetUserById(auth.UserId);
+ if (!user.Policy.EnableAudioPlaybackTranscoding)
+ {
+ state.OutputAudioCodec = "copy";
+ }
+ }
+ }
}
private void AttachMediaSourceInfo(StreamState state,