Browse Source

Change default hwdec from enabled to copy. (Tentative)

Ian Walton 3 years ago
parent
commit
5e621b9c05
2 changed files with 16 additions and 7 deletions
  1. 2 2
      resources/settings/settings_description.json
  2. 14 5
      src/settings/SettingsComponent.cpp

+ 2 - 2
resources/settings/settings_description.json

@@ -1,7 +1,7 @@
 [
   {
     "section": "__meta__",
-    "version": 5
+    "version": 6
   },
   {
     "section": "state",
@@ -223,7 +223,7 @@
       },
       {
         "value": "hardwareDecoding",
-        "default": "enabled",
+        "default": "copy",
         "possible_values": [
           [ "enabled", "video.decode.enabled", { "platforms_excluded": "osx" } ],
           [ "enabled", "video.decode.enabled.modern", { "platforms": "osx" } ],

+ 14 - 5
src/settings/SettingsComponent.cpp

@@ -214,14 +214,19 @@ void SettingsComponent::load()
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void SettingsComponent::loadConf(const QString& path, bool storage)
 {
-  bool migrateJmpSettings = false;
+  bool migrateJmpSettings4 = false;
+  bool migrateJmpSettings5 = false;
   QJsonObject json = loadJson(path);
 
   int version = json["version"].toInt(0);
 
-  if (version == 4 && m_settingsVersion == 5)
+  if (version == 4 && m_settingsVersion == 6)
   {
-    migrateJmpSettings = true;
+    migrateJmpSettings4 = true;
+  }
+  else if (version == 5 && m_settingsVersion == 6)
+  {
+    migrateJmpSettings5 = true;
   }
   else if (version != m_settingsVersion)
   {
@@ -264,11 +269,15 @@ void SettingsComponent::loadConf(const QString& path, bool storage)
       sec->setValue(setting, jsonSection.value(setting).toVariant());
   }
 
-  if (migrateJmpSettings) {
+  if (migrateJmpSettings4) {
     getSection(SETTINGS_SECTION_MAIN)->setValue("webMode", "desktop");
     getSection(SETTINGS_SECTION_MAIN)->setValue("layout", "desktop");
     if (getSection(SETTINGS_SECTION_VIDEO)->value("hardwareDecoding") == "disabled") {
-      getSection(SETTINGS_SECTION_VIDEO)->setValue("hardwareDecoding", "enabled");
+      getSection(SETTINGS_SECTION_VIDEO)->setValue("hardwareDecoding", "copy");
+    }
+  } else if (migrateJmpSettings5) {
+    if (getSection(SETTINGS_SECTION_VIDEO)->value("hardwareDecoding") == "enabled") {
+      getSection(SETTINGS_SECTION_VIDEO)->setValue("hardwareDecoding", "copy");
     }
   }
 }