mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-10-30 18:22:48 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			726 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			726 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| 
 | |
| namespace MediaBrowser.Server.Implementations.Sync
 | |
| {
 | |
|     public class SyncHelper
 | |
|     {
 | |
|         public static int? AdjustBitrate(int? 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;
 | |
|         }
 | |
|     }
 | |
| }
 |