|
@@ -1415,49 +1415,16 @@ namespace MediaBrowser.Model.Dlna
|
|
|
return profileMatch;
|
|
|
}
|
|
|
|
|
|
- TranscodeReason inferredReason = 0;
|
|
|
-
|
|
|
var failureReasons = analyzedProfiles[false]
|
|
|
.Select(analysis => analysis.Result)
|
|
|
.Where(result => !containerSupported || !result.TranscodeReason.HasFlag(TranscodeReason.ContainerNotSupported))
|
|
|
- .Select(result => result.TranscodeReason)
|
|
|
- .ToList();
|
|
|
-
|
|
|
- if (failureReasons.FirstOrDefault() == 0)
|
|
|
- {
|
|
|
- inferredReason = TranscodeReason.DirectPlayError;
|
|
|
- }
|
|
|
- else
|
|
|
+ .FirstOrDefault().TranscodeReason;
|
|
|
+ if (failureReasons == 0)
|
|
|
{
|
|
|
- var videoCodecNotSupportedCount = failureReasons.Count(r => r.HasFlag(TranscodeReason.VideoCodecNotSupported));
|
|
|
- var audioCodecNotSupportedCount = failureReasons.Count(r => r.HasFlag(TranscodeReason.AudioCodecNotSupported));
|
|
|
-
|
|
|
- if (!containerSupported)
|
|
|
- {
|
|
|
- inferredReason |= TranscodeReason.ContainerNotSupported;
|
|
|
- }
|
|
|
-
|
|
|
- if (videoCodecNotSupportedCount == failureReasons.Count)
|
|
|
- {
|
|
|
- inferredReason |= TranscodeReason.VideoCodecNotSupported;
|
|
|
- }
|
|
|
-
|
|
|
- if (audioCodecNotSupportedCount == failureReasons.Count)
|
|
|
- {
|
|
|
- inferredReason |= TranscodeReason.AudioCodecNotSupported;
|
|
|
- }
|
|
|
-
|
|
|
- foreach (var transcodeReason in failureReasons)
|
|
|
- {
|
|
|
- var temp = transcodeReason;
|
|
|
- temp &= ~TranscodeReason.ContainerNotSupported;
|
|
|
- temp &= ~TranscodeReason.VideoCodecNotSupported;
|
|
|
- temp &= ~TranscodeReason.AudioCodecNotSupported;
|
|
|
- inferredReason |= temp;
|
|
|
- }
|
|
|
+ failureReasons = TranscodeReason.DirectPlayError;
|
|
|
}
|
|
|
|
|
|
- return (Profile: null, PlayMethod: null, AudioStreamIndex: null, TranscodeReasons: inferredReason);
|
|
|
+ return (Profile: null, PlayMethod: null, AudioStreamIndex: null, TranscodeReasons: failureReasons);
|
|
|
}
|
|
|
|
|
|
private TranscodeReason CheckVideoAudioStreamDirectPlay(MediaOptions options, MediaSourceInfo mediaSource, string container, MediaStream audioStream)
|