소스 검색

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;