Update MediaInfoService.cs

This commit is contained in:
artiume 2020-02-06 17:21:10 -05:00 committed by GitHub
parent c3f749ec66
commit a73ce1d781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -415,11 +415,7 @@ namespace MediaBrowser.Api.Playback
// Beginning of Playback Determination: Attempt DirectPlay first
if (mediaSource.SupportsDirectPlay)
{
if (mediaSource.IsRemote && forceDirectPlayRemoteMediaSource && user.Policy.ForceRemoteSourceTranscoding)
{
mediaSource.SupportsDirectPlay = false;
}
else if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
{
mediaSource.SupportsDirectPlay = false;
}
@ -468,11 +464,7 @@ namespace MediaBrowser.Api.Playback
if (mediaSource.SupportsDirectStream)
{
if (mediaSource.IsRemote && forceDirectPlayRemoteMediaSource && user.Policy.ForceRemoteSourceTranscoding)
{
mediaSource.SupportsDirectStream = false;
}
else if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
{
mediaSource.SupportsDirectStream = false;
}
@ -516,17 +508,6 @@ namespace MediaBrowser.Api.Playback
{
if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
{
if (GetMaxBitrate(maxBitrate, user) < mediaSource.Bitrate)
{
options.MaxBitrate = GetMaxBitrate(maxBitrate, user);
}
else
{
options.MaxBitrate = mediaSource.Bitrate;
}
}
else
{
options.MaxBitrate = GetMaxBitrate(maxBitrate, user);
}
@ -543,7 +524,10 @@ namespace MediaBrowser.Api.Playback
streamInfo.StartPositionTicks = startTimeTicks;
mediaSource.TranscodingUrl = streamInfo.ToUrl("-", auth.Token).TrimStart('-');
mediaSource.TranscodingUrl += "&allowVideoStreamCopy=false";
mediaSource.TranscodingUrl += "&allowAudioStreamCopy=false";
if (!allowAudioStreamCopy)
{
mediaSource.TranscodingUrl += "&allowAudioStreamCopy=false";
}
mediaSource.TranscodingContainer = streamInfo.Container;
mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol;