From 6af3dc91c5595c6a440f5597bd4269751cf4102a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 30 Jul 2016 00:21:26 -0400 Subject: [PATCH] adjust audio transcoding bitrate --- MediaBrowser.Model/Dlna/StreamBuilder.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index c05ca4187..80e81a41a 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -600,18 +600,22 @@ namespace MediaBrowser.Model.Dlna { defaultBitrate = 192000; } + if (!string.IsNullOrEmpty(targetAudioCodec) && audioStream != null && StringHelper.EqualsIgnoreCase(audioStream.Codec, targetAudioCodec)) + { + defaultBitrate = audioStream.BitRate ?? defaultBitrate; + } if (targetAudioChannels.HasValue) { - if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 2000000) + if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 1500000) { if (StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3")) { - defaultBitrate = 448000; + defaultBitrate = Math.Max(448000, defaultBitrate); } else { - defaultBitrate = 320000; + defaultBitrate = Math.Max(320000, defaultBitrate); } } }