mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 22:13:06 +03:00
fixes #1310 - Downscaling 1280x720 to 720x404
This commit is contained in:
@@ -14,14 +14,29 @@ namespace MediaBrowser.Model.Dlna
|
||||
new ResolutionConfiguration(1280, 2500000)
|
||||
};
|
||||
|
||||
public static ResolutionOptions Normalize(int maxBitrate,
|
||||
string codec,
|
||||
public static ResolutionOptions Normalize(int? inputBitrate,
|
||||
int outputBitrate,
|
||||
string inputCodec,
|
||||
string outputCodec,
|
||||
int? maxWidth,
|
||||
int? maxHeight)
|
||||
{
|
||||
foreach (var config in Configurations)
|
||||
// If the bitrate isn't changing, then don't downlscale the resolution
|
||||
if (inputBitrate.HasValue && outputBitrate >= inputBitrate.Value)
|
||||
{
|
||||
if (maxWidth.HasValue || maxHeight.HasValue)
|
||||
{
|
||||
return new ResolutionOptions
|
||||
{
|
||||
MaxWidth = maxWidth,
|
||||
MaxHeight = maxHeight
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var config in Configurations)
|
||||
{
|
||||
if (maxBitrate <= config.MaxBitrate)
|
||||
if (outputBitrate <= config.MaxBitrate)
|
||||
{
|
||||
var originvalValue = maxWidth;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user