Browse Source

Probe MF resolution only if system video decoders are to be used

This probing might cause additional problems - so avoid using it until
we use system video decoders by default.
Vincent Lang 8 years ago
parent
commit
9368ffe75d
1 changed files with 24 additions and 21 deletions
  1. 24 21
      src/player/CodecsComponent.cpp

+ 24 - 21
src/player/CodecsComponent.cpp

@@ -246,6 +246,18 @@ bool CodecDriver::isWhitelistedSystemVideoCodec() const
   return false;
 }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+static bool useSystemAudioDecoders()
+{
+  return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+static bool useSystemVideoDecoders()
+{
+  return SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "useSystemVideoCodecs").toBool();
+}
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Returns "" on error.
 static QString loadDeviceID()
@@ -361,16 +373,19 @@ void Codecs::probeCodecs()
     throw FatalException("Could not read device-id.");
 
 #ifdef Q_OS_WIN32
-  if (probeDecoder("h264_mf", ":/testmedia/high_4096x2304.h264"))
-    g_mediaFoundationH264MaxResolution = QSize(4096, 2304);
-  else if (probeDecoder("h264_mf", ":/testmedia/high_4096x2160.h264"))
-    g_mediaFoundationH264MaxResolution = QSize(4096, 2160);
-  else if (probeDecoder("h264_mf", ":/testmedia/high_4096x1080.h264"))
-    g_mediaFoundationH264MaxResolution = QSize(4096, 1080);
-  else
-    g_systemVideoDecoderWhitelist.remove("h264_mf");
+  if (useSystemVideoDecoders())
+  {
+    if (probeDecoder("h264_mf", ":/testmedia/high_4096x2304.h264"))
+      g_mediaFoundationH264MaxResolution = QSize(4096, 2304);
+    else if (probeDecoder("h264_mf", ":/testmedia/high_4096x2160.h264"))
+      g_mediaFoundationH264MaxResolution = QSize(4096, 2160);
+    else if (probeDecoder("h264_mf", ":/testmedia/high_4096x1080.h264"))
+      g_mediaFoundationH264MaxResolution = QSize(4096, 1080);
+    else
+      g_systemVideoDecoderWhitelist.remove("h264_mf");
 
-  QLOG_DEBUG() << "h264_mf max. resolution:" << g_mediaFoundationH264MaxResolution;
+    QLOG_DEBUG() << "h264_mf max. resolution:" << g_mediaFoundationH264MaxResolution;
+  }
 #endif
 
 #ifdef Q_OS_MAC
@@ -610,18 +625,6 @@ void Downloader::networkFinished(QNetworkReply* pReply)
   m_WebCtrl.clearAccessCache(); // make sure the TCP connection is closed
 }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-static bool useSystemAudioDecoders()
-{
-  return true;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-static bool useSystemVideoDecoders()
-{
-  return SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "useSystemVideoCodecs").toBool();
-}
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 static CodecDriver selectBestDecoder(const StreamInfo& stream)
 {