summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/CS/HandBrakeWPF/App.xaml.cs2
-rw-r--r--win/CS/HandBrakeWPF/Utilities/Portable.cs16
-rw-r--r--win/CS/HandBrakeWPF/portable.ini.template4
3 files changed, 20 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs
index c784eb7a5..ce31b066d 100644
--- a/win/CS/HandBrakeWPF/App.xaml.cs
+++ b/win/CS/HandBrakeWPF/App.xaml.cs
@@ -124,7 +124,7 @@ namespace HandBrakeWPF
// NO-Hardware Mode
- bool noHardware = e.Args.Any(f => f.Equals("--no-hardware"));
+ bool noHardware = e.Args.Any(f => f.Equals("--no-hardware")) || (Portable.IsPortable() && !Portable.IsHardwareEnabled());
// Initialise the Engine
HandBrakeWPF.Helpers.LogManager.Init();
diff --git a/win/CS/HandBrakeWPF/Utilities/Portable.cs b/win/CS/HandBrakeWPF/Utilities/Portable.cs
index 2cfbce6e9..ecde42d82 100644
--- a/win/CS/HandBrakeWPF/Utilities/Portable.cs
+++ b/win/CS/HandBrakeWPF/Utilities/Portable.cs
@@ -177,6 +177,22 @@ namespace HandBrakeWPF.Utilities
return true;
}
+ public static bool IsHardwareEnabled()
+ {
+ if (keyPairs.ContainsKey("hardware.enabled"))
+ {
+ string hardwareEnabled = keyPairs["hardware.enabled"];
+ if (!string.IsNullOrEmpty(hardwareEnabled) && hardwareEnabled.Trim() == "true")
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ return true; // Default to On.
+ }
+
/// <summary>
/// The get temp directory.
/// </summary>
diff --git a/win/CS/HandBrakeWPF/portable.ini.template b/win/CS/HandBrakeWPF/portable.ini.template
index 495a73441..c667efece 100644
--- a/win/CS/HandBrakeWPF/portable.ini.template
+++ b/win/CS/HandBrakeWPF/portable.ini.template
@@ -6,6 +6,7 @@
# - storage.dir => Stores Presets, Settings and Log Files.
# - tmp.dir => temporary files only. (i.e Preview images)
# - update.check => true | false (enabled / disabled, default disabled for portable)
+# - hardware.enabled => true | false (Enables the hardware encoders such as QSV, NVENC or VCE)
#
# Set to 'cwd' to use the current applications directory. It will automatically create "storage" and "tmp" folders in this instance.
# Leave blank to use the system "TMP" directory and the "AppData" user profile folder.
@@ -13,4 +14,5 @@
storage.dir = cwd
tmp.dir = cwd
-update.check = false \ No newline at end of file
+update.check = false
+hardware.enabled = true \ No newline at end of file