resolve 128k limit

This commit is contained in:
Luke Pulverenti 2016-08-24 17:06:04 -04:00
parent c46e38725e
commit 0117ee67d8
5 changed files with 5 additions and 52 deletions

View File

@ -27,8 +27,6 @@ namespace MediaBrowser.Model.Configuration
public bool DisplayMissingEpisodes { get; set; }
public bool DisplayUnairedEpisodes { get; set; }
public bool GroupMoviesIntoBoxSets { get; set; }
public string[] ExcludeFoldersFromGrouping { get; set; }
public string[] GroupedFolders { get; set; }

View File

@ -602,19 +602,16 @@ namespace MediaBrowser.Model.Dlna
private int GetAudioBitrate(string subProtocol, int? maxTotalBitrate, int? targetAudioChannels, string targetAudioCodec, MediaStream audioStream)
{
var defaultBitrate = 128000;
if (StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3"))
var defaultBitrate = audioStream.BitRate ?? 192000;
// Reduce the bitrate if we're downmixing
if (targetAudioChannels.HasValue && audioStream != null && audioStream.Channels.HasValue && targetAudioChannels.Value < audioStream.Channels.Value)
{
defaultBitrate = 192000;
}
if (!string.IsNullOrEmpty(targetAudioCodec) && audioStream != null && StringHelper.EqualsIgnoreCase(audioStream.Codec, targetAudioCodec))
{
defaultBitrate = audioStream.BitRate ?? defaultBitrate;
defaultBitrate = StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3") ? 192000 : 128000;
}
if (targetAudioChannels.HasValue)
{
if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 1500000)
if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 1200000)
{
if (StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3"))
{

View File

@ -386,7 +386,6 @@ namespace MediaBrowser.Server.Startup.Common
new MovieDbEpisodeProviderMigration(ServerConfigurationManager),
new DbMigration(ServerConfigurationManager, TaskManager),
new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename),
new CollectionGroupingMigration(ServerConfigurationManager, UserManager),
new CollectionsViewMigration(ServerConfigurationManager, UserManager)
};

View File

@ -70,7 +70,6 @@
<Compile Include="FFMpeg\FFMpegInfo.cs" />
<Compile Include="INativeApp.cs" />
<Compile Include="MbLinkShortcutHandler.cs" />
<Compile Include="Migrations\CollectionGroupingMigration.cs" />
<Compile Include="Migrations\CollectionsViewMigration.cs" />
<Compile Include="Migrations\IVersionMigration.cs" />
<Compile Include="Migrations\DbMigration.cs" />

View File

@ -1,40 +0,0 @@
using System.Linq;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Server.Startup.Common.Migrations
{
public class CollectionGroupingMigration : IVersionMigration
{
private readonly IServerConfigurationManager _config;
private readonly IUserManager _userManager;
public CollectionGroupingMigration(IServerConfigurationManager config, IUserManager userManager)
{
_config = config;
_userManager = userManager;
}
public void Run()
{
var migrationKey = this.GetType().Name;
var migrationKeyList = _config.Configuration.Migrations.ToList();
if (!migrationKeyList.Contains(migrationKey))
{
if (_config.Configuration.IsStartupWizardCompleted)
{
if (_userManager.Users.Any(i => i.Configuration.GroupMoviesIntoBoxSets))
{
_config.Configuration.EnableGroupingIntoCollections = true;
}
}
migrationKeyList.Add(migrationKey);
_config.Configuration.Migrations = migrationKeyList.ToArray();
_config.SaveConfiguration();
}
}
}
}