Revert using Math.Clamp

This commit is contained in:
Cody Robibero 2022-03-12 11:50:12 -07:00
parent e6df698df1
commit d29c7c1d9e

View File

@ -909,8 +909,9 @@ namespace MediaBrowser.Model.Dlna
} }
// Make sure the video bitrate is lower than bitrate settings but at least 64k // Make sure the video bitrate is lower than bitrate settings but at least 64k
// Don't use Math.Clamp as availableBitrateForVideo can be lower then 64k.
var currentValue = playlistItem.VideoBitrate ?? availableBitrateForVideo; var currentValue = playlistItem.VideoBitrate ?? availableBitrateForVideo;
playlistItem.VideoBitrate = Math.Clamp(currentValue, 64_000, availableBitrateForVideo); playlistItem.VideoBitrate = Math.Max(Math.Min(availableBitrateForVideo, currentValue), 64_000);
} }
_logger.LogInformation( _logger.LogInformation(