OSDN Git Service

Fixed VapourSynth detection with newer (R22+) VapourSynth versions. Hopefully.
authorlordmulder <mulder2@gmx.de>
Fri, 29 Nov 2013 17:10:11 +0000 (18:10 +0100)
committerlordmulder <mulder2@gmx.de>
Fri, 29 Nov 2013 17:10:11 +0000 (18:10 +0100)
src/thread_vapoursynth.cpp
src/version.h
src/win_main.cpp
src/win_updater.cpp

index 460e269..2b309ae 100644 (file)
@@ -227,14 +227,26 @@ bool VapourSynthCheckThread::detectVapourSynthPath3(QString &path)
        bool vapoursynthComplete = false;
        if(!vapoursynthPath.isEmpty())
        {
+               static const char *CORE_PATH[2] = { "core32", "core" };
                qDebug("VapourSynth Dir: %s", vapoursynthPath.toUtf8().constData());
-               m_vpsExePath = new QFile(QString("%1/core/vspipe.exe").arg(vapoursynthPath));
-               m_vpsDllPath = new QFile(QString("%1/core/vapoursynth.dll").arg(vapoursynthPath));
-               qDebug("VapourSynth EXE: %s", m_vpsExePath->fileName().toUtf8().constData());
-               qDebug("VapourSynth DLL: %s", m_vpsDllPath->fileName().toUtf8().constData());
-               if(m_vpsExePath->open(QIODevice::ReadOnly) && m_vpsDllPath->open(QIODevice::ReadOnly))
+               for(int i = 0; (i < 2) && (!vapoursynthComplete); i++)
                {
-                       vapoursynthComplete = x264_is_executable(m_vpsExePath->fileName());
+                       QFileInfo vpsExeInfo(QString("%1/%2/vspipe.exe"     ).arg(vapoursynthPath, CORE_PATH[i]));
+                       QFileInfo vpsDllInfo(QString("%1/%2/vapoursynth.dll").arg(vapoursynthPath, CORE_PATH[i]));
+                       qDebug("VapourSynth EXE: %s", vpsExeInfo.absoluteFilePath().toUtf8().constData());
+                       qDebug("VapourSynth DLL: %s", vpsDllInfo.absoluteFilePath().toUtf8().constData());
+                       if(vpsExeInfo.exists() && vpsDllInfo.exists())
+                       {
+                               m_vpsExePath = new QFile(vpsExeInfo.canonicalFilePath());
+                               m_vpsDllPath = new QFile(vpsDllInfo.canonicalFilePath());
+                               if(m_vpsExePath->open(QIODevice::ReadOnly) && m_vpsDllPath->open(QIODevice::ReadOnly))
+                               {
+                                       vapoursynthComplete = x264_is_executable(m_vpsExePath->fileName());
+                                       break;
+                               }
+                               X264_DELETE(m_vpsExePath);
+                               X264_DELETE(m_vpsDllPath);
+                       }
                }
                if(!vapoursynthComplete)
                {
index 53efe10..ebd99aa 100644 (file)
@@ -26,7 +26,7 @@
 #define VER_X264_MAJOR 2
 #define VER_X264_MINOR 2
 #define VER_X264_PATCH 7
-#define VER_X264_BUILD 665
+#define VER_X264_BUILD 671
 
 #define VER_X264_MINIMUM_REV 2363
 #define VER_X264_CURRENT_API 140
index 3fc53ef..0b5fecb 100644 (file)
@@ -911,6 +911,9 @@ void MainWindow::init(void)
 
        //Update initialized flag
        m_initialized = true;
+
+       //FIXME
+       QTimer::singleShot(1000, this, SLOT(checkUpdates()));
 }
 
 /*
index b300a51..6847261 100644 (file)
@@ -28,6 +28,7 @@
 #include <QMovie>
 #include <QCloseEvent>
 #include <QTimer>
+#include <QMessageBox>
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -77,6 +78,7 @@ UpdaterDialog::UpdaterDialog(QWidget *parent)
        ui->labelInfo->hide();
        ui->labelUrl->hide();
 
+       /*
        //TEST
        QBlake2Checksum checksum;
        checksum.update("The quick brown fox jumps over the lazy dog");
@@ -84,12 +86,15 @@ UpdaterDialog::UpdaterDialog(QWidget *parent)
 
        //TEST
        QBlake2Checksum checksum2;
-       QFile file("");
+       QFile file("G:\\Aktorwerkstoffe.2013-11-22.rar");
        if(file.open(QIODevice::ReadOnly))
        {
                checksum2.update(file);
                qWarning("Result: %s\n", checksum2.finalize().constData());
        }
+       */
+
+       QMessageBox::information(this, "Disclaimer", "Welcome to the auto-updater mockup demo!");
 }
 
 UpdaterDialog::~UpdaterDialog(void)
@@ -102,6 +107,8 @@ UpdaterDialog::~UpdaterDialog(void)
 // Public Functions
 ///////////////////////////////////////////////////////////////////////////////
 
+/*None yet*/
+
 ///////////////////////////////////////////////////////////////////////////////
 // Events
 ///////////////////////////////////////////////////////////////////////////////