Suggestions from review

This commit is contained in:
Cody Robibero 2022-03-06 18:17:49 -07:00
parent dbea7cac67
commit da41cd365c
1 changed files with 2 additions and 3 deletions

View File

@ -909,9 +909,8 @@ 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
long currentValue = playlistItem.VideoBitrate ?? availableBitrateForVideo; var currentValue = playlistItem.VideoBitrate ?? availableBitrateForVideo;
var longBitrate = Math.Max(Math.Min(availableBitrateForVideo, currentValue), 64000); playlistItem.VideoBitrate = Math.Clamp(currentValue, availableBitrateForVideo, 64_000);
playlistItem.VideoBitrate = longBitrate >= int.MaxValue ? int.MaxValue : Convert.ToInt32(longBitrate);
} }
_logger.LogInformation( _logger.LogInformation(