Address comments

This commit is contained in:
Bond_009 2019-01-21 16:57:10 +01:00
parent 06d9423f00
commit 2f8f9e6853

View file

@ -149,13 +149,9 @@ namespace MediaBrowser.Model.Dlna
{ {
switch (condition.Property) switch (condition.Property)
{ {
case ProfileConditionValue.AudioBitrate when condition.Condition == ProfileConditionType.LessThanEqual:
return TranscodeReason.AudioBitrateNotSupported;
case ProfileConditionValue.AudioBitrate: case ProfileConditionValue.AudioBitrate:
return TranscodeReason.AudioBitrateNotSupported; return TranscodeReason.AudioBitrateNotSupported;
case ProfileConditionValue.AudioChannels when condition.Condition == ProfileConditionType.LessThanEqual:
return TranscodeReason.AudioChannelsNotSupported;
case ProfileConditionValue.AudioChannels: case ProfileConditionValue.AudioChannels:
return TranscodeReason.AudioChannelsNotSupported; return TranscodeReason.AudioChannelsNotSupported;
@ -898,7 +894,7 @@ namespace MediaBrowser.Model.Dlna
if (targetAudioChannels.HasValue && audioStream.Channels.HasValue && targetAudioChannels.Value < audioStream.Channels.Value) if (targetAudioChannels.HasValue && audioStream.Channels.HasValue && targetAudioChannels.Value < audioStream.Channels.Value)
{ {
// Reduce the bitrate if we're downmixing // Reduce the bitrate if we're downmixing
defaultBitrate = targetAudioChannels.Value <= 2 ? 128000 : 192000; defaultBitrate = targetAudioChannels.Value < 2 ? 128000 : 192000;
} }
else else
{ {
@ -1252,27 +1248,20 @@ namespace MediaBrowser.Model.Dlna
{ {
if (!string.IsNullOrEmpty(transcodingContainer)) if (!string.IsNullOrEmpty(transcodingContainer))
{ {
var normalizedContainers = ContainerProfile.SplitValue(transcodingContainer); string[] normalizedContainers = ContainerProfile.SplitValue(transcodingContainer);
if (ContainerProfile.ContainsContainer(normalizedContainers, "ts")) if (ContainerProfile.ContainsContainer(normalizedContainers, "ts")
|| ContainerProfile.ContainsContainer(normalizedContainers, "mpegts")
|| ContainerProfile.ContainsContainer(normalizedContainers, "mp4"))
{ {
return false; return false;
} }
else if (ContainerProfile.ContainsContainer(normalizedContainers, "mpegts")) else if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv")
{ || ContainerProfile.ContainsContainer(normalizedContainers, "matroska"))
return false;
}
else if (ContainerProfile.ContainsContainer(normalizedContainers, "mp4"))
{
return false;
}
else if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv") ||
ContainerProfile.ContainsContainer(normalizedContainers, "matroska"))
{ {
return true; return true;
} }
} }
return false; return false;
} }