Browse Source

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 years ago
parent
commit
592af53b5d
1 changed files with 12 additions and 2 deletions
  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 << "Codec: " << MPV_PROPERTY("audio-codec") << endl;
   info << "Bitrate: " << MPV_PROPERTY("audio-bitrate") << endl;
   info << "Bitrate: " << MPV_PROPERTY("audio-bitrate") << endl;
   info << "Channels (input): " << MPV_PROPERTY("audio-params/channels") << 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 << endl;
   info << "Performance: " << endl;
   info << "Performance: " << endl;
   info << "A/V: " << MPV_PROPERTY("avsync") << endl;
   info << "A/V: " << MPV_PROPERTY("avsync") << endl;