aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/Playback/MediaInfoService.cs14
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionNormalizer.cs5
-rw-r--r--MediaBrowser.Model/Users/UserPolicy.cs2
3 files changed, 19 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs
index 0b989784c..91e62b4e3 100644
--- a/MediaBrowser.Api/Playback/MediaInfoService.cs
+++ b/MediaBrowser.Api/Playback/MediaInfoService.cs
@@ -284,6 +284,13 @@ namespace MediaBrowser.Api.Playback
options.ForceDirectPlay = true;
}
}
+ else if (item is Video)
+ {
+ if (!user.Policy.EnableAudioPlaybackTranscoding && !user.Policy.EnableVideoPlaybackTranscoding && !user.Policy.EnablePlaybackRemuxing)
+ {
+ options.ForceDirectPlay = true;
+ }
+ }
// The MediaSource supports direct stream, now test to see if the client supports it
var streamInfo = string.Equals(item.MediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase) ?
@@ -315,6 +322,13 @@ namespace MediaBrowser.Api.Playback
options.ForceDirectStream = true;
}
}
+ else if (item is Video)
+ {
+ if (!user.Policy.EnableAudioPlaybackTranscoding && !user.Policy.EnableVideoPlaybackTranscoding && !user.Policy.EnablePlaybackRemuxing)
+ {
+ options.ForceDirectStream = true;
+ }
+ }
// The MediaSource supports direct stream, now test to see if the client supports it
var streamInfo = string.Equals(item.MediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase) ?
diff --git a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
index ed18fed65..fb353b016 100644
--- a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -59,8 +60,8 @@ namespace MediaBrowser.Model.Dlna
private static double GetVideoBitrateScaleFactor(string codec)
{
- if (string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase) ||
- string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase))
+ if (StringHelper.EqualsIgnoreCase(codec, "h265") ||
+ StringHelper.EqualsIgnoreCase(codec, "hevc"))
{
return .5;
}
diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs
index 16b4b673d..3917b1662 100644
--- a/MediaBrowser.Model/Users/UserPolicy.cs
+++ b/MediaBrowser.Model/Users/UserPolicy.cs
@@ -41,6 +41,7 @@ namespace MediaBrowser.Model.Users
public bool EnableMediaPlayback { get; set; }
public bool EnableAudioPlaybackTranscoding { get; set; }
public bool EnableVideoPlaybackTranscoding { get; set; }
+ public bool EnablePlaybackRemuxing { get; set; }
public bool EnableContentDeletion { get; set; }
public bool EnableContentDownloading { get; set; }
@@ -76,6 +77,7 @@ namespace MediaBrowser.Model.Users
EnableMediaPlayback = true;
EnableAudioPlaybackTranscoding = true;
EnableVideoPlaybackTranscoding = true;
+ EnablePlaybackRemuxing = true;
EnableLiveTvManagement = true;
EnableLiveTvAccess = true;