瀏覽代碼

Do not show channel count on debug overlay when using passthrough

This usually showed "stereo" output when passthrough was enabled, and
without any context that it was using passthrough. Pretty misleading.
Vincent Lang 9 年之前
父節點
當前提交
592af53b5d
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      src/player/PlayerComponent.cpp

+ 12 - 2
src/player/PlayerComponent.cpp

@@ -816,8 +816,18 @@ QString PlayerComponent::videoInformation() const
   info << "Codec: " << MPV_PROPERTY("audio-codec") << endl;
   info << "Bitrate: " << MPV_PROPERTY("audio-bitrate") << endl;
   info << "Channels (input): " << MPV_PROPERTY("audio-params/channels") << endl;
-  info << "Channels (output): " << MPV_PROPERTY("audio-out-params/hr-channels")
-                                << " (" << MPV_PROPERTY("audio-out-params/channels") << ")" << endl;
+  // Guess if it's a passthrough format. Don't show the channel layout in this
+  // case, because it's confusing.
+  QString audio_format = MPV_PROPERTY("audio-out-params/format");
+  if (audio_format.startsWith("spdif-"))
+  {
+    info << "Channels (output): passthrough (" << audio_format << ")";
+  }
+  else
+  {
+    info << "Channels (output): " << MPV_PROPERTY("audio-out-params/hr-channels")
+                                  << " (" << MPV_PROPERTY("audio-out-params/channels") << ")" << endl;
+  }
   info << endl;
   info << "Performance: " << endl;
   info << "A/V: " << MPV_PROPERTY("avsync") << endl;