• R/O
  • HTTP
  • SSH
  • HTTPS

x264-launcher: Commit

Simple x264 Launcher development repository


Commit MetaInfo

Revisionb235200318be6f10f9f8e4bc8d643b208215e6d8 (tree)
Time2019-10-06 05:25:38
Authorlordmulder <mulder2@gmx....>
Commiterlordmulder

Log Message

Adapted for recent changes in NVEncC progress output.

Change Summary

Incremental Difference

--- a/src/encoder_nvencc.cpp
+++ b/src/encoder_nvencc.cpp
@@ -48,6 +48,26 @@ static const unsigned int VERSION_NVENCC_MINIMUM_VER = 449;
4848
4949 #define NVENCC_UPDATE_PROGRESS(X) do \
5050 { \
51+ bool ok[2] = { false, false }; \
52+ unsigned int progressInt = (X)->cap(1).toUInt(&ok[0]); \
53+ unsigned int progressFrc = (X)->cap(2).toUInt(&ok[1]); \
54+ setStatus(JobStatus_Running); \
55+ if(ok[0] && ok[1]) \
56+ { \
57+ const double progress = (double(progressInt) / 100.0) + (double(progressFrc) / 1000.0); \
58+ if(!qFuzzyCompare(progress, last_progress)) \
59+ { \
60+ setProgress(floor(progress * 100.0)); \
61+ size_estimate = qFuzzyIsNull(size_estimate) ? estimateSize(m_outputFile, progress) : ((0.667 * size_estimate) + (0.333 * estimateSize(m_outputFile, progress))); \
62+ last_progress = progress; \
63+ } \
64+ } \
65+ setDetails(line.mid(offset).trimmed()); \
66+} \
67+while(0)
68+
69+#define NVENCC_UPDATE_PROGRESS_NOPROG(X) do \
70+{ \
5171 bool ok = false; \
5272 unsigned int progressFrames = (X)->cap(1).toUInt(&ok); \
5373 double progress = 0.0; \
@@ -377,7 +397,8 @@ void NVEncEncoder::buildCommandLine(QStringList &cmdLine, const bool &usePipe, c
377397
378398 void NVEncEncoder::runEncodingPass_init(QList<QRegExp*> &patterns)
379399 {
380- patterns << new QRegExp("^(\\d+) frames:");
400+ patterns << new QRegExp("\\[(\\d+)\\.(\\d+)%\\].+frames", Qt::CaseInsensitive);
401+ patterns << new QRegExp("^(\\d+) frames:", Qt::CaseInsensitive);
381402 patterns << new QRegExp("Selected\\s+codec\\s+is\\s+not\\s+supported", Qt::CaseInsensitive);
382403 patterns << new QRegExp("nvEncodeAPI.dll\\s+does\\s+not\\s+exists\\s+in\\s+your\\s+system", Qt::CaseInsensitive);
383404 }
@@ -391,10 +412,14 @@ void NVEncEncoder::runEncodingPass_parseLine(const QString &line, const QList<QR
391412 }
392413 else if ((offset = patterns[1]->lastIndexIn(line)) >= 0)
393414 {
394- log(QString("ERROR: YOUR HARDWARE DOES *NOT* SUPPORT THE '%1' CODEC !!!\n").arg(s_nvencEncoderInfo.variantToString(m_options->encVariant())));
415+ NVENCC_UPDATE_PROGRESS_NOPROG(patterns[1]);
395416 }
396417 else if ((offset = patterns[2]->lastIndexIn(line)) >= 0)
397418 {
419+ log(QString("ERROR: YOUR HARDWARE DOES *NOT* SUPPORT THE '%1' CODEC !!!\n").arg(s_nvencEncoderInfo.variantToString(m_options->encVariant())));
420+ }
421+ else if ((offset = patterns[3]->lastIndexIn(line)) >= 0)
422+ {
398423 log("ERROR: NVIDIA ENCODER API (NVENCODEAPI.DLL) IS *NOT* AVAILABLE !!!\n");
399424 }
400425 else if(!line.isEmpty())
Show on old repository browser