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