/*
* Convert path to short/ANSI path
*/
-QString x264_path2ansi(const QString &longPath)
+QString x264_path2ansi(const QString &longPath, bool makeLowercase)
{
QString shortPath = longPath;
- DWORD buffSize = GetShortPathNameW(reinterpret_cast<const wchar_t*>(longPath.utf16()), NULL, NULL);
+ const QString longPathNative = QDir::toNativeSeparators(longPath);
+ DWORD buffSize = GetShortPathNameW(QWCHAR(longPathNative), NULL, NULL);
if(buffSize > 0)
{
- wchar_t *buffer = new wchar_t[buffSize];
- DWORD result = GetShortPathNameW(reinterpret_cast<const wchar_t*>(longPath.utf16()), buffer, buffSize);
+ wchar_t *buffer = (wchar_t*) _malloca(sizeof(wchar_t) * buffSize);
+ DWORD result = GetShortPathNameW(QWCHAR(longPathNative), buffer, buffSize);
if((result > 0) && (result < buffSize))
{
- shortPath = QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer), result);
+ shortPath = QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const unsigned short*>(buffer), result));
+
+ if(makeLowercase)
+ {
+ QFileInfo info(shortPath);
+ shortPath = QString("%1/%2").arg(info.absolutePath(), info.fileName().toLower());
+ }
}
- delete[] buffer;
+ _freea(buffer);
buffer = NULL;
}
bool x264_is_executable(const QString &path);
bool x264_is_prerelease(void);
void x264_message_handler(QtMsgType type, const char *msg);
-QString x264_path2ansi(const QString &longPath);
+QString x264_path2ansi(const QString &longPath, bool makeLowercase = false);
bool x264_play_sound(const unsigned short uiSoundIdx, const bool bAsync, const wchar_t *alias = NULL);
bool x264_portable(void);
unsigned int x264_process_id(void);
{
cmdLine_Input.append(splitParams(m_options->customAvs2YUV()));
}
- cmdLine_Input << x264_path2ansi(QDir::toNativeSeparators(m_sourceFileName));
+ cmdLine_Input << QDir::toNativeSeparators(x264_path2ansi(m_sourceFileName, true));
cmdLine_Input << "-";
log("Creating Avisynth process:");
if(!startProcess(processInput, AVS2_BINARY(m_binDir, avs2yuv_x64), cmdLine_Input, false))
}
break;
case INPUT_VAPOUR:
- cmdLine_Input << x264_path2ansi(QDir::toNativeSeparators(m_sourceFileName));
+ cmdLine_Input << QDir::toNativeSeparators(x264_path2ansi(m_sourceFileName, true));
cmdLine_Input << "-" << "-y4m";
log("Creating Vapoursynth process:");
if(!startProcess(processInput, VPSP_BINARY(m_vpsDir), cmdLine_Input, false))
}
cmdLine << "-frames" << "1";
- cmdLine << x264_path2ansi(QDir::toNativeSeparators(m_sourceFileName)) << "NUL";
+ cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFileName, true)) << "NUL";
log("Creating process:");
if(!startProcess(process, AVS2_BINARY(m_binDir, x64), cmdLine))
QProcess process;
QStringList cmdLine;
- cmdLine << x264_path2ansi(QDir::toNativeSeparators(m_sourceFileName));
+ cmdLine << QDir::toNativeSeparators(x264_path2ansi(m_sourceFileName, true));
cmdLine << "-" << "-info";
log("Creating process:");
#define VER_X264_MAJOR 2
#define VER_X264_MINOR 2
#define VER_X264_PATCH 5
-#define VER_X264_BUILD 610
+#define VER_X264_BUILD 612
#define VER_X264_MINIMUM_REV 2363
#define VER_X264_CURRENT_API 140