Disable timeouts with 0 values

This commit is contained in:
manongjohn 2021-03-15 18:17:06 -04:00 committed by manongjohn
parent 4442f02561
commit 1a97781e8c
5 changed files with 15 additions and 9 deletions

View file

@ -15,7 +15,10 @@
Ffmpeg::Ffmpeg() {
m_ffmpegPath = Preferences::instance()->getFfmpegPath();
m_ffmpegTimeout = Preferences::instance()->getFfmpegTimeout();
if (m_ffmpegTimeout > 0) m_ffmpegTimeout * 1000;
if (m_ffmpegTimeout > 0)
m_ffmpegTimeout * 1000;
else
m_ffmpegTimeout = -1;
std::string strPath = m_ffmpegPath.toStdString();
m_intermediateFormat = "png";
}

View file

@ -46,7 +46,7 @@ public:
private:
QString m_intermediateFormat, m_ffmpegPath, m_audioPath, m_audioFormat;
int m_frameCount = 0, m_lx, m_ly, m_bpp, m_bitsPerSample, m_channelCount,
m_ffmpegTimeout = 30000, m_frameNumberOffset = -1;
m_ffmpegTimeout = -1, m_frameNumberOffset = -1;
double m_frameRate = 24.0;
bool m_ffmpegExists = false, m_ffprobeExists = false, m_hasSoundTrack = false;
TFilePath m_path;

View file

@ -835,7 +835,10 @@ void LipSyncPopup::onApplyButton() {
}
runRhubarb();
int rhubarbTimeout = Preferences::instance()->getRhubarbTimeout();
if (rhubarbTimeout > 0) rhubarbTimeout * 1000;
if (rhubarbTimeout > 0)
rhubarbTimeout * 1000;
else
rhubarbTimeout = -1;
m_rhubarb->waitForFinished(rhubarbTimeout);
m_progressDialog->hide();
QString results = m_rhubarb->readAllStandardError();

View file

@ -1043,10 +1043,10 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
// Import / Export
{ffmpegPath, tr("Executable Directory:")},
{ffmpegTimeout, tr("Import/Export Timeout (sec; -1 = no timeout):")},
{ffmpegTimeout, tr("Import/Export Timeout (seconds):")},
{fastRenderPath, tr("Fast Render Output Directory:")},
{rhubarbPath, tr("Executable Directory:")},
{rhubarbTimeout, tr("Analyze Audio Timeout (sec; -1 = no timeout):") },
{rhubarbTimeout, tr("Analyze Audio Timeout (seconds):")},
// Drawing
{scanLevelType, tr("Scan File Format:")},
@ -1635,7 +1635,7 @@ QWidget* PreferencesPopup::createImportExportPage() {
QGridLayout* rhubarbOptionsLay = insertGroupBox(tr("Rhubarb Lip Sync"), lay);
{
insertUI(rhubarbPath, rhubarbOptionsLay);
insertUI(rhubarbPath, rhubarbOptionsLay);
insertUI(rhubarbTimeout, rhubarbOptionsLay);
}

View file

@ -446,12 +446,12 @@ void Preferences::definePreferenceItems() {
// Import / Export
define(ffmpegPath, "ffmpegPath", QMetaType::QString, "");
define(ffmpegTimeout, "ffmpegTimeout", QMetaType::Int, -1, -1,
define(ffmpegTimeout, "ffmpegTimeout", QMetaType::Int, 0, 0,
std::numeric_limits<int>::max());
define(fastRenderPath, "fastRenderPath", QMetaType::QString, "desktop");
define(rhubarbPath, "rhubarbPath", QMetaType::QString, "");
define(rhubarbTimeout, "rhubarbTimeout", QMetaType::Int, -1, -1,
std::numeric_limits<int>::max());
define(rhubarbTimeout, "rhubarbTimeout", QMetaType::Int, 0, 0,
std::numeric_limits<int>::max());
// Drawing
define(scanLevelType, "scanLevelType", QMetaType::QString, "tif");