From 1c1aa7c2c56c42a3d23fff945b2bde444ed5d4a3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 8 Jul 2017 03:27:36 -0400 Subject: [PATCH] 3.2.23.1 --- .../Playback/Hls/DynamicHlsService.cs | 19 +++++++++++++------ SharedVersion.cs | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 664735dfe..93ccd3cb2 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -779,18 +779,18 @@ namespace MediaBrowser.Api.Playback.Hls protected override string GetAudioArguments(StreamState state) { - var codec = EncodingHelper.GetAudioEncoder(state); + var audioCodec = EncodingHelper.GetAudioEncoder(state); if (!state.IsOutputVideo) { - if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(audioCodec, "copy", StringComparison.OrdinalIgnoreCase)) { return "-acodec copy"; } var audioTranscodeParams = new List(); - audioTranscodeParams.Add("-acodec " + codec); + audioTranscodeParams.Add("-acodec " + audioCodec); if (state.OutputAudioBitrate.HasValue) { @@ -811,12 +811,19 @@ namespace MediaBrowser.Api.Playback.Hls return string.Join(" ", audioTranscodeParams.ToArray()); } - if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(audioCodec, "copy", StringComparison.OrdinalIgnoreCase)) { - return "-codec:a:0 copy -copypriorss:a:0 0"; + var videoCodec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions()); + + if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase) && state.EnableBreakOnNonKeyFrames(videoCodec)) + { + return "-codec:a:0 copy -copypriorss:a:0 0"; + } + + return "-codec:a:0 copy"; } - var args = "-codec:a:0 " + codec; + var args = "-codec:a:0 " + audioCodec; var channels = state.OutputAudioChannels; diff --git a/SharedVersion.cs b/SharedVersion.cs index f7871ef69..0e07c788d 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.22.7")] +[assembly: AssemblyVersion("3.2.23.1")]