aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Sync/SyncHelper.cs
blob: 7fe703796f3ece419c147b5e30971bf8a32a0390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;

namespace Emby.Server.Implementations.Sync
{
    public class SyncHelper
    {
        public static long? AdjustBitrate(long? profileBitrate, string quality)
        {
            if (profileBitrate.HasValue)
            {
                if (string.Equals(quality, "medium", StringComparison.OrdinalIgnoreCase))
                {
                    profileBitrate = Math.Min(profileBitrate.Value, 4000000);
                }
                else if (string.Equals(quality, "low", StringComparison.OrdinalIgnoreCase))
                {
                    profileBitrate = Math.Min(profileBitrate.Value, 1500000);
                }
            }

            return profileBitrate;
        }
    }
}