Bläddra i källkod

Make surround downmix more similar to PHT

...because users seem to want it.

While I'm not perfectly sure that the behavior matches now, the
downmixing coefficients are now the same as with PHT. It's up to the
users to decide whether this change does any good.

We forcibly disable codec downmix, because if the user selects stereo
output, the decoder will normally do the downmix, and ignore our custom
remix options (as libswresample won't be used at all). Potentially this
has bad effects on RPI performance, or other weak CPUs.
Vincent Lang 9 år sedan
förälder
incheckning
85f6c8b660
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. 7 0
      src/player/PlayerComponent.cpp

+ 7 - 0
src/player/PlayerComponent.cpp

@@ -78,6 +78,9 @@ bool PlayerComponent::componentInitialize()
   // aborting playback immediately).
   mpv_set_option_string(m_mpv, "audio-fallback-to-null", "yes");
 
+  // Do not let the decoder downmix (better customization for us).
+  mpv::qt::set_option_variant(m_mpv, "ad-lavc-downmix", false);
+
   // Make it load the hwdec interop, so hwdec can be enabled at runtime.
   mpv::qt::set_option_variant(m_mpv, "hwdec-preload", "auto");
 
@@ -657,6 +660,10 @@ void PlayerComponent::setAudioConfiguration()
   QString resampleOpts = "";
   bool normalize = SettingsComponent::Get().value(SETTINGS_SECTION_AUDIO, "normalize").toBool();
   resampleOpts += QString(":normalize=") + (normalize ? "yes" : "no");
+
+  // Make downmix more similar to PHT.
+  resampleOpts += ":o=[surround_mix_level=1,lfe_mix_level=1]";
+
   mpv::qt::set_option_variant(m_mpv, "af-defaults", "lavrresample" + resampleOpts);
 
   QString passthroughCodecs;