• R/O
  • HTTP
  • SSH
  • HTTPS

x264-launcher: Commit

Simple x264 Launcher development repository


Commit MetaInfo

Revision3d620d791c891da28d8c9bb31a9408ac9b1c3772 (tree)
Time2019-08-09 21:33:57
Authorlordmulder <mulder2@gmx....>
Commiterlordmulder

Log Message

Small tweak to VapourSynth detection.

Change Summary

Incremental Difference

--- a/src/thread_vapoursynth.cpp
+++ b/src/thread_vapoursynth.cpp
@@ -61,10 +61,10 @@ static const char* const VPS_REG_NAME = "VapourSynthDLL";
6161 //Enable detection of "portabel" edition?
6262 #define ENABLE_PORTABLE_VPS true
6363
64-//-------------------------------------
65-// Auxilary functions
66-//-------------------------------------
64+//Registry scope EOL flag
65+#define REG_SCOPE_EOL (MUtils::Registry::reg_scope_t(-1))
6766
67+//Auxilary functions
6868 #define BOOLIFY(X) ((X) ? '1' : '0')
6969 #define VPS_BITNESS(X) (((X) + 1U) * 32U)
7070
@@ -163,11 +163,16 @@ int VapourSynthCheckThread::threadMain(void)
163163 VAPOURSYNTH_X64,
164164 NULL
165165 };
166- static const MUtils::Registry::reg_scope_t REG_SCOPE[3] =
166+ static const MUtils::Registry::reg_scope_t REG_SCOPE_X86[] =
167+ {
168+ MUtils::Registry::scope_default,
169+ REG_SCOPE_EOL
170+ };
171+ static const MUtils::Registry::reg_scope_t REG_SCOPE_X64[] =
167172 {
168173 MUtils::Registry::scope_wow_x32,
169174 MUtils::Registry::scope_wow_x64,
170- MUtils::Registry::scope_default
175+ REG_SCOPE_EOL
171176 };
172177
173178 QHash<int, QFileInfo> vpsDllInfo, vpsExeInfo;
@@ -192,20 +197,24 @@ int VapourSynthCheckThread::threadMain(void)
192197 //Read VapourSynth path from registry
193198 if (vpsDllInfo.isEmpty() && vpsExeInfo.isEmpty())
194199 {
195- for (size_t i = 0; i < 3U; i++)
200+ const MUtils::Registry::reg_scope_t* const scope = (MUtils::OS::os_architecture() == MUtils::OS::ARCH_X64) ? REG_SCOPE_X64 : REG_SCOPE_X86;
201+ for (size_t i = 0; scope[i] != REG_SCOPE_EOL; i++)
196202 {
197- if (MUtils::Registry::reg_key_exists(MUtils::Registry::root_machine, QString::fromLatin1(VPS_REG_PATH), REG_SCOPE[i]))
203+ if (MUtils::Registry::reg_key_exists(MUtils::Registry::root_machine, QString::fromLatin1(VPS_REG_PATH), scope[i]))
198204 {
199205 QString vpsRegDllPath;
200- if (MUtils::Registry::reg_value_read(MUtils::Registry::root_machine, QString::fromLatin1(VPS_REG_PATH), QString::fromLatin1(VPS_REG_NAME), vpsRegDllPath, REG_SCOPE[i]))
206+ if (MUtils::Registry::reg_value_read(MUtils::Registry::root_machine, QString::fromLatin1(VPS_REG_PATH), QString::fromLatin1(VPS_REG_NAME), vpsRegDllPath, scope[i]))
201207 {
202208 QFileInfo vpsRegDllInfo(QDir::fromNativeSeparators(vpsRegDllPath));
203209 vpsRegDllInfo.makeAbsolute();
204210 if (vpsRegDllInfo.exists() && vpsRegDllInfo.isFile())
205211 {
206- const int flag = getVapourSynthType(REG_SCOPE[i]);
207- vpsDllInfo.insert(flag, vpsRegDllInfo);
208- vpsExeInfo.insert(flag, vpsRegDllInfo.absoluteDir().absoluteFilePath(VPS_EXE_NAME)); /*derive VSPipe.EXE path from VapourSynth.DLL path for now!*/
212+ const int flag = getVapourSynthType(scope[i]);
213+ if((!vpsDllInfo.contains(flag)) || (!vpsExeInfo.contains(flag)))
214+ {
215+ vpsDllInfo.insert(flag, vpsRegDllInfo);
216+ vpsExeInfo.insert(flag, vpsRegDllInfo.absoluteDir().absoluteFilePath(VPS_EXE_NAME)); /*derive VSPipe.EXE path from VapourSynth.DLL path for now!*/
217+ }
209218 }
210219 }
211220 }
@@ -222,6 +231,7 @@ int VapourSynthCheckThread::threadMain(void)
222231 //Validate the VapourSynth installation now!
223232 for (size_t i = 0; i < 2U; i++)
224233 {
234+ qDebug("VapourSynth %u-Bit support is being tested.", VPS_BITNESS(i));
225235 if (vpsDllInfo.contains(VPS_BIT_FLAG[i]) && vpsExeInfo.contains(VPS_BIT_FLAG[i]))
226236 {
227237 QFile *vpsExeFile, *vpsDllFile;
@@ -260,19 +270,21 @@ int VapourSynthCheckThread::threadMain(void)
260270
261271 VapourSynthCheckThread::VapourSynthFlags VapourSynthCheckThread::getVapourSynthType(const int scope)
262272 {
263- if (MUtils::OS::os_architecture() != MUtils::OS::ARCH_X64)
264- {
265- return VAPOURSYNTH_X86;
266- }
267-
268- switch (scope)
273+ if (MUtils::OS::os_architecture() == MUtils::OS::ARCH_X64)
269274 {
275+ switch (scope)
276+ {
270277 case MUtils::Registry::scope_wow_x32:
271278 return VAPOURSYNTH_X86;
272279 case MUtils::Registry::scope_wow_x64:
273280 return VAPOURSYNTH_X64;
274281 default:
275282 return VAPOURSYNTH_DEF;
283+ }
284+ }
285+ else
286+ {
287+ return VAPOURSYNTH_X86; /*ignore scope on 32-Bit OS*/
276288 }
277289 }
278290
--- a/src/version.h
+++ b/src/version.h
@@ -26,7 +26,7 @@
2626 #define VER_X264_MAJOR 2
2727 #define VER_X264_MINOR 9
2828 #define VER_X264_PATCH 3
29-#define VER_X264_BUILD 1181
29+#define VER_X264_BUILD 1182
3030
3131 #define VER_X264_PORTABLE_EDITION (0)
3232
Show on old repository browser