jellyfin/Emby.Server.Implementations/Sync/SyncHelper.cs

25 lines
718 B
C#
Raw Normal View History

2015-03-15 10:50:47 -07:00
using System;
2016-11-03 15:34:16 -07:00
namespace Emby.Server.Implementations.Sync
2015-03-15 10:50:47 -07:00
{
public class SyncHelper
{
public static int? AdjustBitrate(int? profileBitrate, string quality)
{
if (profileBitrate.HasValue)
{
if (string.Equals(quality, "medium", StringComparison.OrdinalIgnoreCase))
{
2016-03-01 21:46:10 -07:00
profileBitrate = Math.Min(profileBitrate.Value, 4000000);
2015-03-15 10:50:47 -07:00
}
else if (string.Equals(quality, "low", StringComparison.OrdinalIgnoreCase))
{
2016-03-01 21:46:10 -07:00
profileBitrate = Math.Min(profileBitrate.Value, 1500000);
2015-03-15 10:50:47 -07:00
}
}
return profileBitrate;
}
}
}