aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Dlna/StreamBuilder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Dlna/StreamBuilder.cs')
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index bb41c9979..62d67c025 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -1174,7 +1174,6 @@ namespace MediaBrowser.Model.Dlna
var reason = a & flag;
if (reason != 0)
{
- a = reason;
return index;
}
@@ -1184,6 +1183,8 @@ namespace MediaBrowser.Model.Dlna
return index;
};
+ var containerSupported = false;
+
// Check DirectPlay profiles to see if it can be direct played
var analyzedProfiles = profile.DirectPlayProfiles
.Where(directPlayProfile => directPlayProfile.Type == DlnaProfileType.Video)
@@ -1197,6 +1198,10 @@ namespace MediaBrowser.Model.Dlna
{
directPlayProfileReasons |= TranscodeReason.ContainerNotSupported;
}
+ else
+ {
+ containerSupported = true;
+ }
// Check video codec
string videoCodec = videoStream?.Codec;
@@ -1239,7 +1244,7 @@ namespace MediaBrowser.Model.Dlna
{
playMethod = PlayMethod.DirectPlay;
}
- else if (directStreamFailureReasons == 0 && isEligibleForDirectStream && mediaSource.SupportsDirectStream && directPlayProfile is not null)
+ else if (directStreamFailureReasons == 0 && isEligibleForDirectStream && mediaSource.SupportsDirectStream)
{
playMethod = PlayMethod.DirectStream;
}
@@ -1261,7 +1266,10 @@ namespace MediaBrowser.Model.Dlna
return profileMatch;
}
- var failureReasons = analyzedProfiles[false].Select(analysis => analysis.Result).FirstOrDefault().TranscodeReason;
+ var failureReasons = analyzedProfiles[false]
+ .Select(analysis => analysis.Result)
+ .Where(result => !containerSupported || (result.TranscodeReason & TranscodeReason.ContainerNotSupported) == 0)
+ .FirstOrDefault().TranscodeReason;
if (failureReasons == 0)
{
failureReasons = TranscodeReason.DirectPlayError;