Skip to content

Commit

Permalink
Merge pull request jellyfin#11774 from Bond-009/downmix
Browse files Browse the repository at this point in the history
Apply audio boost when downmixing regardless of downmixalgo
  • Loading branch information
nielsvanvelzen committed May 21, 2024
2 parents d608f1e + cf04e1d commit 06a5ddd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2641,22 +2641,21 @@ public string GetAudioFilterParam(EncodingJobInfo state, EncodingOptions encodin
&& state.AudioStream.Channels.HasValue
&& state.AudioStream.Channels.Value == 6)
{
if (!encodingOptions.DownMixAudioBoost.Equals(1))
{
filters.Add("volume=" + encodingOptions.DownMixAudioBoost.ToString(CultureInfo.InvariantCulture));
}

switch (encodingOptions.DownMixStereoAlgorithm)
{
case DownMixStereoAlgorithms.Dave750:
filters.Add("volume=4.25");
filters.Add("pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3");
break;
case DownMixStereoAlgorithms.NightmodeDialogue:
filters.Add("pan=stereo|c0=c2+0.30*c0+0.30*c4|c1=c2+0.30*c1+0.30*c5");
break;
case DownMixStereoAlgorithms.None:
default:
if (!encodingOptions.DownMixAudioBoost.Equals(1))
{
filters.Add("volume=" + encodingOptions.DownMixAudioBoost.ToString(CultureInfo.InvariantCulture));
}

break;
}
}
Expand Down

0 comments on commit 06a5ddd

Please sign in to comment.